Casts

functions

cast-string

@function cast-string($value) { ... }

Description

Casts a value to a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

String

Requires

Used by

cast-boolean (aliased as cast-bool )

@function cast-boolean($value) { ... }

Description

Casts a value to a boolean

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

cast-bool (alias for cast-boolean)

@function cast-bool($value) { ... }

Refer to cast-boolean.

cast-list

@function cast-list($values, $separator: space) { ... }

Description

Casts values to a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$values

Some values

Mixed none
$separator

The preferred list separator passed in as the last argument, either space or comma

String

Returns

List

Requires

Used by

cast-map

@function cast-map($pairs) { ... }

Description

Casts values to a map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$pairs

Some key-value pairs, expected as either a map, list, or string

Mixed none

Returns

Map

Requires

cast-number

@function cast-number() { ... }

Description

Casts values to a number

Parameters

None.

Returns

Number or Null

Throws

  • 'Cannot cast-number for invalid character #{$characters}.'

  • 'Cannot cast-number for invalid units #{$unit}.'

Requires

Used by

Author

  • Hugo Giraudel

Colors

functions

brightness

@function brightness($color) { ... }

Description

Calculates the brightness of a color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

Number

Throws

  • Cannot get brightness on non-color #{$color}.

Requires

Author

  • Brendan Saunders

luminance

@function luminance($color) { ... }

Description

Calculates the luminance of a color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

Number

Throws

  • Cannot get luminance on non-color #{$color}.

Requires

Used by

Author

  • Pelle Wessman

contrast-ratio

@function contrast-ratio($color1, $color2) { ... }

Description

Calculates the contrast ratio between two colors

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color1

The first color to compare

Color none
$color2

The second color to compate

Color none

Returns

Number

Throws

  • Function contrast-ratio expects a color for argument $color1 but #{type-of($color1)} was given.

  • Function contrast-ratio expects a color for argument $color2 but #{type-of($color2)} was given.

Requires

Used by

Author

  • Mike Reithmuller

color-contrast

@function color-contrast($color, $dark: $brandy-dark-text, $light: $brandy-light-text) { ... }

Description

Attempts to return a color that best contrasts the input $color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color to contrast against

Color none
$dark

The dark color to be returned when contrasting against light colors

Color
$light

The light color to be returned when contrasting against dark colors

Color

Returns

Color

Throws

  • Function color-contrast expects a color for argument $color but #{type-of($color)} was given.

  • Function color-contrast expects a color for argument $dark but #{type-of($dark)} was given.

  • Function color-contrast expects a color for argument $light but #{type-of($light)} was given.

Requires

Used by

Author

  • Mike Reithmuller

to-hex

@function to-hex($color) { ... }

Description

Outputs the HEX value of the color given

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

Color

In the form rrggbb

Throws

  • Cannot execute to-hex on non-color #{$color}

Requires

to-rgb

@function to-rgb($color) { ... }

Description

Outputs the RGB value of the color given

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

List

In the form (r, g, b)

Throws

  • Cannot execute to-rgb on non-color #{$color}

Requires

to-hsv (aliased as to-hsb )

@function to-hsv($color) { ... }

Description

Outputs the HSV value of the color given

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

List

In the form (h, s, v)

Throws

  • Cannot execute to-hsv on non-color #{$color}

Requires

Used by

to-hsb (alias for to-hsv)

@function to-hsb($color) { ... }

Refer to to-hsv.

to-hsl

@function to-hsl($color) { ... }

Description

Outputs the HSL values of the color given

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

List

In the form (h, s, l)

Throws

  • Cannot execute to-hsl on non-color #{$color}

Requires

cmyk

@function cmyk($c, $m, $y, $k: 0) { ... }

Description

Returns a valid color given CMYK values

Parameters

parameter Name parameter Description parameter Type parameter Default value
$c

A number representing a percentage of cyan

Number none
$m

A number representing a percentage of magenta

Number none
$y

A number representing a percentage of yellow

Number none
$k

A number representing a percentage of black

Number

Returns

Color

Throws

  • Function cmyk expects a number for argument $c but #{type-of($c)} was given.

  • Function cmyk expects a unitless whole number or percentage for argument $c.

  • Function cmyk expects a number for argument $m but #{type-of($m)} was given.

  • Function cmyk expects a unitless whole number or percentage for argument $m.

  • Function cmyk expects a number for argument $y but #{type-of($y)} was given.

  • Function cmyk expects a unitless whole number or percentage for argument $y.

  • Function cmyk expects a number for argument $k but #{type-of($k)} was given.

  • Function cmyk expects a unitless whole number or percentage for argument $k.

Requires

hsv (aliased as hsb )

@function hsv($h, $s, $v) { ... }

Description

Returns a valid color given HSV values

Parameters

parameter Name parameter Description parameter Type parameter Default value
$h

A number representing hue, with or without units deg

Number none
$s

A number representing saturation, with or without units %

Number none
$v

A number representing brightness, with or without units %

Number none

Returns

Color

Throws

  • Function hsv expects a number for argument $h but #{type-of($h)} was given.

  • Function hsv expects a number for argument $s but #{type-of($s)} was given.

  • Function hsv expects a number for argument $v but #{type-of($v)} was given.

Requires

Used by

hsb (alias for hsv)

@function hsb($h, $s, $b) { ... }

Refer to hsv.

tint

@function tint($color, $percent) { ... }

Description

Returns the color mixed with white to create the desired tint amount

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color to be tinted

Color none
$percent

The percentage amount of tint to be applied

Number none

Returns

Color

Throws

  • Cannot execute tint on non-color #{$color}

  • Function tint expects a percentage for argument $percent but #{$percent} was given.

Requires

Used by

Author

  • Hugo Giraudel

shade

@function shade($color, $percent) { ... }

Description

Returns the color mixed with black to create the desired shade amount

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color to be shaded

Color none
$percent

The percentage amount of shade to be applied

Number none

Returns

Color

Throws

  • Cannot execute shade on non-color #{$color}

  • Function shade expects a percentage for argument $percent but #{$percent} was given.

Requires

Used by

Author

  • Hugo Giraudel

tone

@function tone($color, $percent) { ... }

Description

Returns the color mixed with gray to create the desired tone amount

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color to be shaded

Color none
$percent

The percentage amount of shade to be applied

Number none

Returns

Color

Throws

  • Cannot execute tone on non-color #{$color}

  • Function tone expects a percentage for argument $percent but #{$percent} was given.

Requires

Used by

random-color

@function random-color() { ... }

Description

Generates a random color

Parameters

None.

Returns

Color

color-complementary

@function color-complementary($color) { ... }

Description

Gets the complementary color of a given color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

Color

Throws

  • Cannot execute color-complementary on non-color #{$color}

Requires

Used by

color-triad

@function color-triad($color) { ... }

Description

Gets the triad colors of a given color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

List

A list of colors, where the first color is $color

Throws

  • Cannot execute color-triad on non-color #{$color}

Requires

color-analogous

@function color-analogous($color) { ... }

Description

Gets the analogous colors of a given color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

List

A list of colors, where the first color is $color

Throws

  • Cannot execute color-analogous on non-color #{$color}

Requires

Used by

color-split-complementary

@function color-split-complementary($color) { ... }

Description

Gets the split complementary colors of a given color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

List

A list of colors, where the first color is $color

Throws

  • Cannot execute color-split-complementary on non-color #{$color}

Requires

color-rectangle

@function color-rectangle($color) { ... }

Description

Gets the rectangle colors of a given color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

List

A list of colors, where the first color is $color

Throws

  • Cannot execute color-rectangle on non-color #{$color}

Requires

color-square

@function color-square($color) { ... }

Description

Gets the square colors of a given color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none

Returns

List

A list of colors, where the first color is $color

Throws

  • Cannot execute color-square on non-color #{$color}

Requires

color-stops

@function color-stops($color1, $color2, $x: 0) { ... }

Description

Gets $x number of colors between the two given colors

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color1

The first color to use

Color none
$color2

The second color to use

Color none
$x

The desired number of stops to produce

Number

Returns

List

A list of colors, where the first color is $color1 and last color is $color2

Throws

  • Function color-stops expects a color for argument $color1 but #{type-of($color1)} was given.

  • Function color-stops expects a color for argument $color2 but #{type-of($color2)} was given.

  • Function color-stops expects a number for argument $x but #{type-of($x)} was given.

  • Function color-stops expects a positive integer for argument $x but #{$x} was given.

Requires

color-tints

@function color-tints($color, $x: 0, $min: 0%, $max: 100%) { ... }

Description

Gets $x number of tints between the given $min and $max tint percentages

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none
$x

The desired number of tints to produce

Number
$min

The minimum tint percentage to use

Number
$max

The maximum tint percentage to use

Number

Returns

List

A list of colors, where the first color is $color and last color is white if default $min and $max are used

Throws

  • Function color-tints expects a color for argument $color but #{type-of($color)} was given.

  • Function color-tints expects a number for argument $x but #{type-of($x)} was given.

  • Function color-tints expects a percentage for argument $min but #{$min} was given.

  • Function color-tints expects a percentage for argument $max but #{$max} was given.

  • Function color-tints expects a positive integer for argument $x but #{$x} was given.

Requires

color-shades

@function color-shades($color, $x: 0, $min: 0%, $max: 100%) { ... }

Description

Gets $x number of shades between the given $min and $max shade percentages

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none
$x

The desired number of shades to produce

Number
$min

The minimum shade percentage to use

Number
$max

The maximum shade percentage to use

Number

Returns

List

A list of colors, where the first color is $color and last color is black if default $min and $max are used

Throws

  • Function color-shades expects a color for argument $color but #{type-of($color)} was given.

  • Function color-shades expects a number for argument $x but #{type-of($x)} was given.

  • Function color-shades expects a percentage for argument $min but #{$min} was given.

  • Function color-shades expects a percentage for argument $max but #{$max} was given.

  • Function color-shades expects a positive integer for argument $x but #{$x} was given.

Requires

color-tones

@function color-tones($color, $x: 0, $min: 0%, $max: 100%) { ... }

Description

Gets $x number of tones between the given $min and $max tone percentages

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

Some color

Color none
$x

The desired number of tones to produce

Number
$min

The minimum tone percentage to use

Number
$max

The maximum tone percentage to use

Number

Returns

List

A list of colors, where the first color is $color and last color is gray if default $min and $max are used

Throws

  • Function color-tones expects a color for argument $color but #{type-of($color)} was given.

  • Function color-tones expects a number for argument $x but #{type-of($x)} was given.

  • Function color-tones expects a percentage for argument $min but #{$min} was given.

  • Function color-tones expects a percentage for argument $max but #{$max} was given.

  • Function color-tones expects a positive integer for argument $x but #{$x} was given.

Requires

mixins

linear-gradient

@mixin linear-gradient($args..., $important) { ... }

Description

Creates a cross-browser linear gradient

Parameters

parameter Name parameter Description parameter Type parameter Default value
$args

Some arguments defining the gradient

Arglist none
$important

Sets the !important flag if passed in as the last argument

String none

Requires

Used by

layered-linear-gradient

@mixin layered-linear-gradient($gradients..., $important) { ... }

Description

Creates a cross-browser layered linear gradient from one or more gradient arguments

Parameters

parameter Name parameter Description parameter Type parameter Default value
$gradients

One or more argument lists for a gradient

Arglist none
$important

Sets the !important flag if passed in as the last argument

String none

Requires

radial-gradient

@mixin radial-gradient($args..., $important) { ... }

Description

Creates a cross-browser radial gradient

Parameters

parameter Name parameter Description parameter Type parameter Default value
$args

Some arguments defining the gradient

Arglist none
$important

Sets the !important flag if passed in as the last argument

String none

Requires

Used by

layered-radial-gradient

@mixin layered-radial-gradient($gradients..., $important) { ... }

Description

Creates a cross-browser layered radial gradient from one or more gradient arguments

Parameters

parameter Name parameter Description parameter Type parameter Default value
$gradients

One or more argument lists for a gradient

Arglist none
$important

Sets the !important flag if passed in as the last argument

String none

Requires

stripes

@mixin stripes($direction, $colors...) { ... }

Description

Creates a cross-browser striped background from the given colors, where stripes are evenly distributed

Parameters

parameter Name parameter Description parameter Type parameter Default value
$direction

The preferred direction of the striped background

String none
$colors

One or more colors to create a striped background from

Arglist none

Throws

  • Mixin stripes received invalid value #{$direction} for argument $direction.

  • Mixin stripes expects a list of colors for argument $colors but #{$color} was given.

Requires

n-stripes

@mixin n-stripes($direction, $n, $color1..., $color2...) { ... }

Description

Creates a cross-browser striped background with $n stripes from the given colors

Parameters

parameter Name parameter Description parameter Type parameter Default value
$direction

The preferred direction of the striped background

String none
$n

The number of stripes that are desired, a minimum of 2 must be used

Number none
$color1

The first or main stripe color

Arglist none
$color2

The second stripe color

Arglist none

Throws

  • Mixin n-stripes received invalid value #{$direction} for argument $direction.

  • Mixin n-stripes expects an integer greater than or equal to 2 for argument $n but #{$n} was given.

  • Mixin n-stripes expects a list of colors for argument $color1 but #{$color1} was given.

  • Mixin n-stripes expects a list of colors for argument $color2 but #{$color2} was given.

Requires

Comparators

functions

eq

@function eq($a, $b...) { ... }

Description

Compares whether two values are equal

Parameters

parameter Name parameter Description parameter Type parameter Default value
$a

First value to compare

Mixed none
$b

Second value to compare

Arglist none

Returns

Boolean

neq

@function neq($a, $b...) { ... }

Description

Compares whether two values are not equal

Parameters

parameter Name parameter Description parameter Type parameter Default value
$a

First value to compare

Mixed none
$b

Second value to compare

Arglist none

Returns

Boolean

gt

@function gt($a, $b...) { ... }

Description

Compares whether the first value is greater than the second value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$a

First value to compare

Mixed none
$b

Second value to compare

Arglist none

Returns

Boolean

gteq

@function gteq($a, $b...) { ... }

Description

Compares whether the first value is greater than or equal to the second value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$a

First value to compare

Mixed none
$b

Second value to compare

Arglist none

Returns

Boolean

lt

@function lt($a, $b...) { ... }

Description

Compares whether the first value is less than the second value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$a

First value to compare

Mixed none
$b

Second value to compare

Arglist none

Returns

Boolean

aeq

@function aeq($a, $b..., $e) { ... }

Description

Compares whether the first value is almost equal to the second value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$a

First value to compare

Mixed none
$b

Second value to compare

Arglist none
$e

Allowed tolerance for errors

Number none

Returns

Boolean

Requires

lteq

@function lteq($a, $b...) { ... }

Description

Compares whether the first value is less than or equal to the second value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$a

First value to compare

Mixed none
$b

Second value to compare

Arglist none

Returns

Boolean

true

@function true($a) { ... }

Description

Determines if a value is equal to true

Parameters

parameter Name parameter Description parameter Type parameter Default value
$a

Some value to test

Mixed none

Returns

Boolean

false

@function false($a) { ... }

Description

Determines if a value is equal to false

Parameters

parameter Name parameter Description parameter Type parameter Default value
$a

Some value to test

Mixed none

Returns

Boolean

Components

mixins

grid

@mixin grid($name: 'grid', $items: 'griditem', $columns: 12, $rows: 100, $gutter: 25, $units: 'px' 'em' 'pct', $breaks: $brandy-screens-map) { ... }

Description

Creates a responsive grid system on the fly based on the given configurations

Parameters

parameter Name parameter Description parameter Type parameter Default value
$name

The class name used for the grid system

String
$items

The class name used for each item within the grid system

String
$columns

The maximum number of columns in the grid system

Number
$rows

The maximum number of rows in the grid system

Number
$gutter

The maximum gutter size for the grid system

Number
$units

One or more units that the grid system supports, used to calculate gutter from class declarations

List
$breaks

The recognized breakpoints at which the grid system will be responsive

List

Requires

burger

@mixin burger($width: 100%, $height: 5px, $gutter: 5px, $color: $brandy-dark-text, $radius: 0, $transition: all .25s) { ... }

Description

Creates a burger icon using pseudo elements :before and :after

Parameters

parameter Name parameter Description parameter Type parameter Default value
$width

The desired width of each bar within the burger icon

Number
$height

The desired height of each bar within the burger icon

Number
$gutter

The desired distance between bars within the burger icon

Number
$color

The desired color(s) of each bar within the burger icon

Color</code> or <code>List
$radius

The amount of border radius to add to each bar within the burger icon

Number
$transition

The transition to be added to the burger icon during transition effects

Number

Requires

Author

  • Joren Van Hee

burger-mods

@mixin burger-mods() { ... }

Description

Allows further modification of the burger icon using @content directive. Intended for use with burger mixin.

Parameters

None.

Author

  • Joren Van Hee

burger-buns

@mixin burger-buns() { ... }

Description

Allows further modification of the top and bottom burger bars using @content directive. Intended for use with burger mixin.

Parameters

None.

Author

  • Joren Van Hee

burger-top

@mixin burger-top() { ... }

Description

Allows further modification of the top burger bar using @content directive. Intended for use with burger mixin.

Parameters

None.

Author

  • Joren Van Hee

burger-bottom

@mixin burger-bottom() { ... }

Description

Allows further modification of the bottom burger bar using @content directive. Intended for use with burger mixin.

Parameters

None.

Author

  • Joren Van Hee

burger-middle

@mixin burger-middle() { ... }

Description

Allows further modification of the middle burger bar using @content directive. Intended for use with burger mixin.

Parameters

None.

Author

  • Joren Van Hee

burger-to-close

@mixin burger-to-close($color: null) { ... }

Description

Adds a transformation animation to a burger icon, turning it into a close icon (X)

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

The preferred color of the close icon

Color</code> or <code>Null

Requires

Author

  • Joren Van Hee

Configurations

variables

brandy-dark-text

$brandy-dark-text: rgb(51, 51, 51) !default;

Description

Sets the dark color value for the color-contrast() function. The dark color will be returned when contrasting against light backgrounds. Note, the color-contrast() function will attempt to contrast foreground and background colors according to WebAIM accessibility standards.

Type

Color

Used by

brandy-light-text

$brandy-light-text: rgb(255, 255, 255) !default;

Description

Sets the light color value for the color-contrast() function. The light color will be returned when contrasting against dark backgrounds. Note, the color-contrast() function will attempt to contrast foreground and background colors according to WebAIM accessibility standards.

Type

Color

Used by

brandy-font-size

$brandy-font-size: 16px !default;

Description

Sets the default font size for unit conversion functions. Typically, this font size should be set equal to the font size used for your body element.

Type

Number

Used by

brandy-bg-contrast

$brandy-bg-contrast: false !default;

Description

Set the color-contrast() function to use the given background color to generate dark and light color values. Setting this to true tells the color-contrast() function to ignore the values set for $brandy-dark-text and $brandy-light-text. Setting this to false will tell the color-contrast() function to use those values instead. Note, the light and dark colors generated will be a shade or tint of the input background color, respectively.

Type

Boolean

Used by

brandy-colors-map

$brandy-colors-map: (
                    'black': (
                      'base': #000000
                    ),
                    'white': (
                      'base': #FFFFFF
                    ),
                    'grey': (
                      'base': #CCCCCC,
                      'dark': #333333,
                      'light': #EFEFEF
                    ),
                    'gray': (
                      'base': #CCCCCC,
                      'dark': #333333,
                      'light': #EFEFEF
                    )
                  ) !default;

Description

Sets the default map to be used for the color() function. This value can be set equal to a map or a variable which references a map. This map can have up to three levels of depth, where first-level properties should be color names, second-level properties should be color tones, and optionally, third-level keys should be tonal amounts.

Type

Map

Map structure

map key Name map key Description map key Type map key Value
<colorId>

A preferred identifier for the given color

String none
<colorId>.base

The default color tone

Color none
<colorId>.<toneId>

Additional color tones

Color</code> or <code>Map none
<colorId>.<toneId>.<toneAmount>

A tonal amount, usually representative of a percentage

Color none

Example

Sample definition

$brandy-colors-map (
                        'white': (
                          'base': white,
                          'off': whitesmoke
                          'opaque': ( 
                            25: rgba(white, .25),
                            50: rgba(white, .50),
                            75: rgba(white, .75)
                          )
                        )
                      );

Used by

brandy-fonts-map

$brandy-fonts-map: (
                    'sans-serif': sans-serif,
                    'serif': serif,
                    'monospace': monospace,
                    'cursive': cursive
                  ) !default;

Description

Sets the default map to be used for the font() function. This value can be set equal to a map or a variable which references a map and may contain up to two levels of depth.

Type

Map

Map structure

map key Name map key Description map key Type map key Value
<fontId>

A preferred identifier for the given font or font family

Font</code> or <code>List</code> or <code>Map none
<fontId>.<fontClass>

A sub-class of a given font or font family

Font</code> or <code>List none

Example

Sample definition

$brandy-fonts-map: (
                        'heading': (Impact, sans-serif),
                        'body': (
                          'text': (Arial, sans-serif),
                          'lead': (Georgia, serif)
                        )
                      );

Used by

brandy-screens-map

$brandy-screens-map: (
                    'mobile': max-width 400px,
                    'tablet': 401px 800px,
                    'desktop': min-width 801px
                  ) !default;

Description

Sets the default map to be used for the screen() function. This value can be set equal to a map or a variable which references a map.

Type

Map

Map structure

map key Name map key Description map key Type map key Value
<screenId>

A breakpoint associated with the corresponding screen identifier

Number none

Example

Sample definition

$brandy-screens-map: (
                        'mobile': max-width 400px,
                        'tablet': 401px 800px,
                        'desktop':  min-width 801px
                      );

Used by

brandy-z-map

$brandy-z-map: (
                    'modal':  99,
                    'overlay': 88,
                    'menu': 77,
                    'dropdown': 66,
                    'header': 55,
                    'default': auto,
                    'normal': 1,
                    'below': -1
                  ) !default;

Description

Sets the default map to be used for the z() function. This value can be set equal to a map or a variable which references a map.

Type

Map

Map structure

map key Name map key Description map key Type map key Value
<zLayer>

A z-index layer

Number none

Example

Sample definition

$brandy-z-map: (
                        'modal':  99,
                        'overlay': 88,
                        'menu': 77,
                        'dropdown': 66,
                        'header': 55,
                        'default': auto,
                        'normal': 1,
                        'underneath': -1
                      );

Used by

brandy-scale-map

$brandy-scale-map: (
                    'mobile': 1,
                    'tablet': 1,
                    'desktop': 1
                  ) !default;

Description

Sets the default map to be used for the scale-font() function. This value can be set equal to a map or a variable which references a map. Each property name in the map should also correspond to a key in the $brandy-screens-map.

Type

Map

Map structure

map key Name map key Description map key Type map key Value
<screenId>

A font scale associated with the corresponding screen identifier

Number none

Example

Sample definition

$brandy-scale-map: (
                        'mobile': 1,
                        'table': 1,
                        'desktop': 1
                      );

brandy-config-map

$brandy-config-map: () !default;

Description

Sets the default map to be used for the config() function. This value can be set equal to a map or a variable which references a map and can be nested as deep as desired.

Type

Map

Map structure

map key Name map key Description map key Type map key Value
<configId>

Some global configuration

Mixed none

Example

Sample definition

$brandy-config-map: (
                        'page-width': 900px,
                      );

Used by

brandy-const-map

$brandy-const-map: (
                    'PI': 3.1415926535897932384626433832795028841971693993751,
                    'E': 2.71828182845904523536028747135266249775724709369995,
                    'LN(2)': 0.6931471805599453,
                    'Z-INDEX': (
                      'MIN': −2147483648,
                      'MAX': 2147483648
                    )
                  ) !default;

Description

Sets the default map to be used for the const() function. This value can be set equal to a map or a variable which references a map and can be nested as deep as desired.

Type

Map

Map structure

map key Name map key Description map key Type map key Value
<constId>

Some global constant or set of constants

Mixed none

Example

Sample definition

$brandy-const-map: (
                        'PI': 3.14159265358979323846264338327950288,
                      );

Used by

brandy-units

$brandy-units: (
                    'px': 0px,
                    'pt': 0pt,
                    'pc': 0pc,
                    'pica': 0pica,
                    'em': 0em,
                    'rem': 0rem,
                    'mm': 0mm,
                    'cm': 0cm,
                    'in': 0in,
                    'ex': 0ex,
                    'ch': 0ch,
                    'vw': 0vw,
                    'vh': 0vh,
                    'vmax': 0vmax,
                    'vmin': 0vmin,
                    'deg': 0deg,
                    'rad': 0rad,
                    'grad': 0grad,
                    'turn': 0turn,
                    'pct': 0%,
                    '%': 0%,
                    's': 0s,
                    'ms': 0ms,
                    'dpcm': 0dpcm,
                    'dppx': 0dppx,
                    'hz': 0hz,
                    'khz': 0khz,
                    'Hz': 0hz,
                    'kHz': 0khz,
                    'dpi': 0dpi
                  ) !default;

Description

Defines the recognized units that Brandy uses for some functions and mixins.

Type

Map

Used by

brandy-symbols

$brandy-symbols: '~' '`' '!' '@' '#' '$' '%' '^' '&' '*' '(' ')' '-' '_' '+' '=' '{' '}' '[' ']' '|' '\\' '\'' '"' ':' ';' '<' ',' '>' '.' '?' '/';

Description

Defines the recognized symbolic characters that Brandy uses for some functions and mixins.

Type

List

Used by

brandy-letters

$brandy-letters: (
                    'a': 'A',
                    'b': 'B',
                    'c': 'C',
                    'd': 'D',
                    'e': 'E',
                    'f': 'F',
                    'g': 'G',
                    'h': 'H',
                    'i': 'I',
                    'j': 'J',
                    'k': 'K',
                    'l': 'L',
                    'm': 'M',
                    'n': 'N',
                    'o': 'O',
                    'p': 'P',
                    'q': 'Q',
                    'r': 'R',
                    's': 'S',
                    't': 'T',
                    'u': 'U',
                    'v': 'V',
                    'w': 'W',
                    'x': 'X',
                    'y': 'Y',
                    'z': 'Z',
                  ) !default;

Description

Defines the recognized alphabet characters that Brandy uses for some functions and mixins. Use the map keys to represent lowercase letters and map values to represent uppercase letters.

Type

Map

Used by

brandy-numbers

$brandy-numbers: (
                    '0': 0,
                    '1': 1,
                    '2': 2,
                    '3': 3,
                    '4': 4,
                    '5': 5,
                    '6': 6,
                    '7': 7,
                    '8': 8,
                    '9': 9
                  ) !default;

Description

Defines the recognized numeric characters that Brandy uses for some function and mixins. Use the map keys to represent numbers in string form and the map values to represent numbers in their numeric form.

Type

Map

Used by

brandy-title-blacklist

$brandy-title-blacklist: 'a' 'an' 'the' 'and' 'but' 'for' 'yet' 'at' 'by' 'from' 'to' 'as' 'in' 'or' 'for' 'nor' 'on' 'of' 'up' !default;

Description

Defines a list of words that should not be capitalized when converting a string to titlecase.

Type

List

Used by

brandy-sort-order

$brandy-sort-order: (
                    "!", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", "[", "\\", "]", "^", "_", "{", "|", "}", "~",
                    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
                    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
                  ) !default;

Description

Defines the default sort order for characters

Type

List

Used by

Fonts

functions

font-source

@function font-source($family, $path, $formats: 'ttf' 'woff' 'woff2' 'eot' 'svg', $replacement: '-') { ... }

Description

Builds a font source declaration for use with @font-face definitions

Parameters

parameter Name parameter Description parameter Type parameter Default value
$family

The preferred name for the font family, also used for the main identifier in .svg files

String none
$path

The path to the font file, including the filename but excluding the file extension

String none
$formats

The available font formats as a list of file extensions

List
$replacement

A string used to replace spaces in font family names

String

Returns

List

Throws

  • Function font-source expects a string for argument $family but #{type-of($family)} was given.

  • Function font-source expects a string for argument $path but #{type-of($path)} was given.

  • Function font-source expects a string for argument $replacement but #{type-of($replacement)} was given.

  • Function font-source expects a list for argument $formats but #{type-of($formats)} was given.

  • Function font-source does not recognize the invalid font format #{$format}.

Requires

Used by

Author

  • Thoughtbot, Inc.

mixins

google-font

@mixin google-font($fonts...) { ... }

Description

Loads a font from Google Fonts

Parameters

parameter Name parameter Description parameter Type parameter Default value
$fonts

A list of font names followed by any font weights, such as Lato 300 400, Raleway 300

Arglist none

Throws

  • 'Mixin google-font could not load invalid font weight #{$w}.'

Requires

scale-font

@mixin scale-font($elements, $min, $max, $save, $increasing: false, $responsive: true, $scale: $brandy-scale-map, $breaks: $brandy-screens-map) { ... }

Description

Allows font size to be proportionately scaled across breakpoints and/or a given set of elements

Parameters

parameter Name parameter Description parameter Type parameter Default value
$elements

A list of elements that should have font sizes assigned according to scale

List none
$min

The minimum font size allowed when scaling

Number none
$max

The maximum font size allowed when scaling

Number none
$save

A variable pointing to a map where scaled font sizes should be saved to at a global level or null otherwise

Map</code> or <code>Null none
$increasing

Whether to increase or decrease font sizes according to scale

Boolean
$responsive

Whether to also make font sizes scale responsive across defined breakpoints

Boolean
$scale

A map containing font scales by breakpoint name

Map
$breaks

A map containing named breakpoints

Map

Throws

  • Mixin scale-font expects a number for argument $min but #{type-of($min)} was given.

  • Mixin scale-font expects a number for argument $max but #{type-of($max)} was given.

  • Mixin scale-font expects true or false for argument $increasing but #{$increasing} was given.

  • Mixin scale-font expects true or false for argument $responsive but #{$responsive} was given.

Requires

font-face

@mixin font-face($family, $path, $formats: 'ttf' 'woff2' 'woff' 'eot' 'svg') { ... }

Description

Creates a @font-face declaration

Parameters

parameter Name parameter Description parameter Type parameter Default value
$family

Some font family name

String none
$path

The path to the font file including the filename but excluding the file extension

String none
$formats

A list of supported font formats

List

Requires

Author

  • Thoughbot, Inc.

Getters

functions

config

@function config($property) { ... }

Description

Gets a value from the $brandy-config-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

A property from the configuration set given in dot notation

String none

Returns

Mixed

Throws

  • Unknown configuration #{$property}.

Requires

const

@function const($property) { ... }

Description

Gets a value from the $brandy-const-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

A property from the constants map given in dot notation

String none

Returns

Mixed

Throws

  • Unknown constant #{$property}.

Requires

Used by

color

@function color($property, $tone: 'base', $variation: 'base') { ... }

Description

Gets a value from the $brandy-colors-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

A property from the colors map given in dot notation

String none
$tone

A preferred color tone

String
$variation

A tonal variation from the selected tone

String

Returns

Mixed

Throws

  • Unknown color #{$property}.

Requires

font

@function font($property) { ... }

Description

Gets a value from the $brandy-fonts-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

A property from the fonts map given in dot notation

String none

Returns

Mixed

Throws

  • Unknown font #{$property}.

Requires

screen

@function screen($property) { ... }

Description

Gets a value from the $brandy-screens-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

A property from the screens map given in dot notation

String none

Returns

Mixed

Throws

  • Unknown screen #{$property}.

Requires

z

@function z($property) { ... }

Description

Gets a value from the $brandy-z-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

A property from the z map given in dot notation

String none

Returns

Mixed

Throws

  • Unknown z-layer #{$property}.

Requires

Helpers

functions

positional-value

@function positional-value($value, $position: null) { ... }

Description

Gets a positional value form a position-oriented property value.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

The prosition-oriented property value that a positional value should be extracted from

List none
$position

An optional positional value to extract otherwise all positional values are extracted

String

Returns

Mixed

Requires

opposite-direction

@function opposite-direction($directions...) { ... }

Description

Inverts one or more directions

Parameters

parameter Name parameter Description parameter Type parameter Default value
$directions

Directions to be inverted

Arglist none

Returns

String or List

Throws

  • No opposite direction found for #{$direction}.

mixins

expand-properties

@mixin expand-properties($props) { ... }

Description

Expands a map of key-value pairs to property-value declarations

Parameters

parameter Name parameter Description parameter Type parameter Default value
$props

A map of properties and their values to be expanded

Map none

Requires

Layout

mixins

border-right-radius

@mixin border-right-radius($radius) { ... }

Description

Adds a border radius to the right side of an element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$radius

Some radius amount

Number none

border-top-radius

@mixin border-top-radius($radius) { ... }

Description

Adds a border radius to the top side of an element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$radius

Some radius amount

Number none

border-left-radius

@mixin border-left-radius($radius) { ... }

Description

Adds a border radius to the left side of an element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$radius

Some radius amount

Number none

border-bottom-radius

@mixin border-bottom-radius($radius) { ... }

Description

Adds a border radius to the bottom side of an element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$radius

Some radius amount

Number none

border-diagonal-radius

@mixin border-diagonal-radius($radius, $direction) { ... }

Description

Adds a border radius to on an element the given diagonal

Parameters

parameter Name parameter Description parameter Type parameter Default value
$radius

Some radius amount

Number none
$direction

Whether to start at the top left or right corner

String none

Throws

  • Mixin border-diagonal-radius expects left or right for argument $direction but #{$direction} was given.

Requires

size

@mixin size($size) { ... }

Description

Sets the width and height equally for an element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$size

Some length

Number none

Used by

aspect-ratio

@mixin aspect-ratio($ratio, $width) { ... }

Description

Sets the fluid aspect ratio of an element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$ratio

Some aspect ratio in the form of width / height

Number none
$width

The desired width as a percentage

Number none

Throws

  • Mixin aspect-ratio expects a percentage for argument $width but #{$width} was given.

Requires

margin-y

@mixin margin-y($margin) { ... }

Description

Sets top and bottom margin equally

Parameters

parameter Name parameter Description parameter Type parameter Default value
$margin

Some margin size

Number none

Used by

margin-x

@mixin margin-x($margin) { ... }

Description

Sets left and right margin equally

Parameters

parameter Name parameter Description parameter Type parameter Default value
$margin

Some margin size

Number none

margin-center

@mixin margin-center() { ... }

Description

Sets left and right margin to auto, used for centering block-level elements

Parameters

None.

padding-y

@mixin padding-y($padding) { ... }

Description

Sets top and bottom padding equally

Parameters

parameter Name parameter Description parameter Type parameter Default value
$padding

Some padding size

Number none

padding-x

@mixin padding-x($padding) { ... }

Description

Sets left and right padding equally

Parameters

parameter Name parameter Description parameter Type parameter Default value
$padding

Some padding size

Number none

border-y

@mixin border-y($border) { ... }

Description

Sets top and bottom border equally

Parameters

parameter Name parameter Description parameter Type parameter Default value
$border

Some border setting

Number none

Used by

border-x

@mixin border-x($border) { ... }

Description

Sets left and right border equally

Parameters

parameter Name parameter Description parameter Type parameter Default value
$border

Some border setting

Number none

Used by

absolute

@mixin absolute($offset) { ... }

Description

A shorthand for absolute positioning

Parameters

parameter Name parameter Description parameter Type parameter Default value
$offset

Some top, right, bottom, and left values, respectively

List</code> or <code>Number none

Requires

relative

@mixin relative($offset) { ... }

Description

A shorthand for relative positioning

Parameters

parameter Name parameter Description parameter Type parameter Default value
$offset

Some top, right, bottom, and left values, respectively

List</code> or <code>Number none

Requires

fixed

@mixin fixed($offset) { ... }

Description

A shorthand for fixed positioning

Parameters

parameter Name parameter Description parameter Type parameter Default value
$offset

Some top, right, bottom, and left values, respectively

List</code> or <code>Number none

Requires

position

@mixin position($offset, $position: null) { ... }

Description

Sets top, right, bottom, left, and optionally position properties in one fell swoop

Parameters

parameter Name parameter Description parameter Type parameter Default value
$offset

Some top, right, bottom, and left values, respectively

List</code> or <code>Number none
$position

The positioning property for the element

String

Requires

Used by

position-y

@mixin position-y($offset, $position: null) { ... }

Description

Sets top, bottom, and optionally position properties in one fell swoop

Parameters

parameter Name parameter Description parameter Type parameter Default value
$offset

Some top and bottom values, respectively

List</code> or <code>Number none
$position

The positioning property for the element

String

Requires

position-x

@mixin position-x($offset, $position: null) { ... }

Description

Sets left, right, and optionally position properties in one fell swoop

Parameters

parameter Name parameter Description parameter Type parameter Default value
$offset

Some left and right values, respectively

List</code> or <code>Number none
$position

The positioning property for the element

String

Requires

absolute-center-within-container

@mixin absolute-center-within-container() { ... }

Description

Absolutely centers an element within its container using absolute positioning. Only works if the container's position is set to absolute or relative.

Parameters

None.

Used by

absolute-center-within-container-x

@mixin absolute-center-within-container-x() { ... }

Description

Absolutely centers an element horizontally within its container using absolute positioning. Only works if the container's position is set to absolute or relative.

Parameters

None.

absolute-center-within-container-y

@mixin absolute-center-within-container-y() { ... }

Description

Absolutely centers an element vertically within its container using absolute positioning. Only works if the container's position is set to absolute or relative.

Parameters

None.

absolute-center-contents

@mixin absolute-center-contents($inline: false) { ... }

Description

Absolutely centers the contents of an element using the flexbox method

Parameters

parameter Name parameter Description parameter Type parameter Default value
$inline

Determines whether the element should be a block or inline element

Boolean

absolute-center-contents-y

@mixin absolute-center-contents-y($inline: false) { ... }

Description

Absolutely centers the contents of an element vertically using the flexbox method

Parameters

parameter Name parameter Description parameter Type parameter Default value
$inline

Determines whether the element should be a block or inline element

Boolean

absolute-center-contents-x

@mixin absolute-center-contents-x($inline: false) { ... }

Description

Absolutely centers the contents of an element horizontally using the flexbox method

Parameters

parameter Name parameter Description parameter Type parameter Default value
$inline

Determines whether the element should be a block or inline element

Boolean

visually-hidden

@mixin visually-hidden($hide: true) { ... }

Description

Hides content visually but still makes content accessible to screen readers

Parameters

parameter Name parameter Description parameter Type parameter Default value
$hide

Whether hide or show the content

Boolean

Throws

  • Mixin visually-hidden expect true or false for argument $hide but #{$hide} was given.

Requires

Author

  • Thoughtbot, Inc.

textually-hidden

@mixin textually-hidden($hide: true) { ... }

Description

Hides text visually, for instance, to allow an image to be shown instead

Parameters

parameter Name parameter Description parameter Type parameter Default value
$hide

Whether to hide or show the content

Boolean

Throws

  • Mixin textually-hidden expect true or false for argument $hide but #{$hide} was given.

Requires

Author

  • Thoughtbot, Inc.

clearfix

@mixin clearfix($before: false) { ... }

Description

Adds a clearfix for floated elements

Parameters

parameter Name parameter Description parameter Type parameter Default value
$before

Whether the clearfix should come ::before or ::after the contents of the element

Boolean

Author

  • Thoughtbot, Inc.

ellipsis

@mixin ellipsis() { ... }

Description

Truncates a single line of text with an ellipsis. Properties overflow, white-space, and text-overflow are essential here. Only works on single lines of text. Multiple lines of text must be truncated with a JavaScript-based solution or similar.

Parameters

None.

Author

  • Thoughtbot, Inc.

Lists

functions

first

@function first($list) { ... }

Description

Retrieves the first item in a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

Mixed

Throws

  • Cannot get first item from non-list #{$list}.

Requires

Used by

Author

  • Hugo Giraudel

last

@function last($list) { ... }

Description

Retrieves the last item in a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

Mixed

Throws

  • Cannot get last item from non-list #{$list}.

Requires

Used by

Author

  • Hugo Giraudel

last-index

@function last-index($list, $value) { ... }

Description

Retrieves the last index of a value in a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$value

Some value to be searched for

Mixed none

Returns

Number

Returns the index of the last occurrence of the value or 0 when not found

Throws

  • Cannot get last-index from non-list #{$list}.

Requires

Author

  • Hugo Giraudel

prepend

@function prepend($list, $value) { ... }

Description

Adds an item to the beginning of a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$value

Some value to add to the beginning of the list

Mixed none

Returns

List

Throws

  • Cannot execute prepend on non-list #{$list}.

Requires

Used by

Author

  • Hugo Giraudel

insert-nth

@function insert-nth($list, $index, $value) { ... }

Description

Inserts a value at the nth index within a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$index

The index where the value should be inserted

Number none
$value

Some value to be inserted into the list

Mixed none

Returns

List

Throws

  • Cannot execute insert-nth on non-list #{$list}.

  • Function insert-nth expects a number for argument $index but #{type-of($index)} was given.

Requires

Used by

Author

  • Hugo Giraudel

replace

@function replace($list, $old, $new, $recursive: false) { ... }

Description

Replaces one or more occurrences of a value within a list with a new value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$old

The old value to be replaced

Mixed none
$new

The new value to be inserted in place of the old value

Mixed none
$recursive

Determines whether only the first occurrence or all occurrences should be replaced

Boolean

Returns

List

Throws

  • Cannot execute replace on non-list #{$list}.

  • Function replace expects true or false for argument $recursive but #{$recursive} was given.

Requires

Author

  • Hugo Giraudel

replace-nth

@function replace-nth($list, $index, $value) { ... }

Description

Replaces a value at the nth index within a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$index

The index where the value should be replaced

Number none
$value

The value to be inserted in place of the old value

Mixed none

Returns

List

Throws

  • Cannot execute replace-nth on non-list #{$list}.

  • Function replace-nth expects a number for argument $index but #{type-of($index)} was given.

Requires

Author

  • Hugo Giraudel

remove

@function remove($list, $value, $recurive: false) { ... }

Description

Removes one or more occurrences of a value from a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$value

Some value to be removed from the list

Mixed none
$recurive

Determines whether only the first occurrence or all occurrences should be removed

Boolean

Returns

List

Throws

  • Cannot execute remove on non-list #{$list}.

  • Function remove expects true or false for argument $recursive but #{$recursive} was given.

Requires

Used by

Author

  • Hugo Giraudel

remove-nth

@function remove-nth($list, $index) { ... }

Description

Rremoves a value at the nth index within a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$index

The index where the value should be removed

Number none

Returns

List

Throws

  • Cannot execute remove-nth on non-list #{$list}.

  • Function remove-nth expects a number for argument $index but #{type-of($index)} was given.

Requires

Author

  • Hugo Giraudel

slice

@function slice($list, $start: 1, $end: length($list)) { ... }

Description

Extracts a subset of a list between a starting and ending point

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$start

The starting index where the slice should begin

Number
$end

The ending index where the slice should stop

Number

Returns

List

Throws

  • Cannot execute slice on non-list #{$list}.

  • Function slice expects a number for argument $start but #{type-of($start)} was given.

  • Function slice expects a number for argument $end but #{type-of($end)} was given.

  • Cannot execute slice when start #{$start} exceeds end #{$end}.

Requires

Used by

Author

  • Hugo Giraudel

reverse

@function reverse($list, $recursive: false) { ... }

Description

Reverses the order of items within a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$recursive

Determines whether nested lists should also be reversed

Boolean

Returns

List

Throws

  • Cannot execute reverse on non-list #{$list}.

  • Function reverse expects true or false for argument $recursive but #{$recursive} was given.

Requires

Used by

Author

  • Hugo Giraudel

shuffle

@function shuffle($list, $recursive: false) { ... }

Description

Shuffles the order of items within a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$recursive

Determines whether nested lists should also be shuffled

Boolean

Returns

List

Throws

  • Cannot execute shuffle on non-list #{$list}.

  • Function shuffle expects true or false for argument $recursive but #{$recursive} was given.

Requires

Used by

glue

@function glue($list, $glue: '', $nested: false) { ... }

Description

Glues a list together with a string to form a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$glue

Acts as the glue between list items

String
$nested

Determines whether the list is part of a nested list, used for recursion

Boolean

Returns

String or Null

Throws

  • Cannot execute glue on non-list #{$list}.

  • Function glue expects a string for argument $glue but #{type-of($glue)} was given.

  • Function glue expects true or false for argument $nested but #{$nested} was given.

Requires

Used by

Author

  • Hugo Giraudel

shift-index

@function shift-index($list, $shift: 1) { ... }

Description

Reindexes a list by the given value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$shift

The number of places by which to shift the list indices

Number

Returns

List

Throws

  • Cannot execute shift-index on non-list #{$list}.

  • Function shift-index expects a number for argument $value but #{type-of($value)} was given.

Requires

Author

  • Ana Tudor

contains

@function contains($list, $search) { ... }

Description

Determines whether or not the list contains the given value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$search

The value to be searched for

Mixed none

Returns

Boolean

Throws

  • Cannot execute contains on non-list #{$list}.

Requires

Used by

starts-with

@function starts-with($list, $search) { ... }

Description

Determines whether or not the list starts with the given value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$search

The value to be searched for

Mixed none

Returns

Boolean

Throws

  • Cannot execute starts-with on non-list #{$list}.

Requires

ends-with

@function ends-with($list, $search) { ... }

Description

Determines whether or not the list ends with the given value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$search

The value to be searched for

Mixed none

Returns

Boolean

Throws

  • Cannot execute ends-with on non-list #{$list}.

Requires

chunk

@function chunk($list, $length) { ... }

Description

Chunks a list into subsets of the given size

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$length

The maximum length of chunked lists

Number none

Returns

List

Throws

  • Cannot execute chunk on non-list #{$list}.

  • Function chunk expects a number for argument $length but #{type-of($length)} was given.

Requires

count

@function count($list, $items...) { ... }

Description

Counts the number of times a value occurs within a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$items

Filters the items to be counted

Arglist none

Returns

Map or Number

Throws

  • Cannot execute count on non-list #{$list}.

  • Function count expects an arglist for argument $items but #{type-of($items)}` was given.

Requires

every

@function every($list, $test, $input...) { ... }

Description

Tests if every item in the list meets some criteria presented by the $test function

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$test

The name of the function to be used as a test

String none
$input

Any arguments to pass into the function

Arglist none

Returns

Boolean

Throws

  • Cannot execute every on non-list #{$list}.

  • Function every expects a string for argument $test but #{type-of($test)} was given.

  • Cannot execute every due to invalid function #{$test}.

Requires

Used by

some

@function some($list, $test, $input...) { ... }

Description

Tests if some items in the list meet some criteria presented by the $test function

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none
$test

The name of the function to be used as a test

String none
$input

Any arguments to pass into the function

Arglist none

Returns

Boolean

Throws

  • Cannot execute some on non-list #{$list}.

  • Function some expects a string for argument $test but #{type-of($test)} was given.

  • Cannot execute some due to invalid function #{$test}.

Requires

is-empty

@function is-empty($list) { ... }

Description

Determines if a list is empty

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

Boolean

Throws

  • Cannot execute is-empty on non-list #{$list}.

Requires

Used by

is-multiple

@function is-multiple($list) { ... }

Description

Determines if a list contains more than one item

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

Boolean

Throws

  • Cannot execute is-multiple on non-list #{$list}.

Requires

is-single

@function is-single($list) { ... }

Description

Determines if a list contains only one item

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

Boolean

Throws

  • Cannot execute is-single on non-list #{$list}.

Requires

unique (aliased as only )

@function unique($list) { ... }

Description

Removes duplicate values from a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

List

Throws

  • Cannot execute unique on non-list #{$list}.

Requires

Used by

is-truthy

@function is-truthy($list) { ... }

Description

Determines if every value in a list is equal to true

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

Boolean

Throws

  • Cannot execute is-truthy on non-list #{$list}.

Requires

is-falsy

@function is-falsy($list) { ... }

Description

Determines if every value in a list is equal to false

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

Boolean

Throws

  • Cannot execute is-falsy on non-list #{$list}.

Requires

intersection

@function intersection($list, $lists...) { ... }

Description

Pinpoints the intersection between two or more lists

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list to be used as a reference

List</code> or <code>Arglist none
$lists

Additional lists to be used for comparison

Arglist none

Returns

List

Throws

  • Cannot execute intersection on non-list #{$list}.

Requires

is-symmetrical

@function is-symmetrical($list) { ... }

Description

Determines whether a list is symmetrical

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

Boolean

Throws

  • Cannot execute is-symmetrical on non-list #{$list}.

Requires

scrub

@function scrub($list) { ... }

Description

Removes empty values, such as null, false, '', and (), from a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

List

Throws

  • Cannot execute scrub on non-list #{$list}.

Requires

chance

@function chance($list) { ... }

Description

Retrieves a random item from a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

Mixed

Throws

  • Cannot execute chance on non-list #{$list}.

  • Cannot return a random value from an empty list.

Requires

range

@function range($n) { ... }

Description

Builds a list with values ranging from 1 through $n

Parameters

parameter Name parameter Description parameter Type parameter Default value
$n

Maximum index

Number none

Returns

List

Throws

  • Function range expects a number for argument $n but #{type-of($n)} was given.

  • Cannot create range from invalid number #{$n}.

  • Cannot create range from negative number #{$n}.

Requires

range-min-max

@function range-min-max($min, $max) { ... }

Description

Builds a list with values ranging from $min through $max

Parameters

parameter Name parameter Description parameter Type parameter Default value
$min

Minimum value

Number none
$max

Maximum value

Number none

Returns

List

Throws

  • Cannot create range from invalid minimum #{$min}.

  • Function range-min-max expects a numnber for argument $min but #{type-of($min)} was given.

  • Cannot create range from invalid maximum #{$max}.

  • Function range-min-max expects a numnber for argument $max but #{type-of($max)} was given.

Requires

range-alpha

@function range-alpha($x, $lowercase: true) { ... }

Description

Builds a list with values ranging from a through $x

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Maximum index

String none
$lowercase

Whether the result should be lowercase or uppercase

Boolean

Returns

List

Throws

  • Function range-alpha expects a string for argument $x but #{type-of($x)} was given.

  • Function range-alpha expects true or false for argument $lowercase but #{$lowercase} was given.

  • Cannot create range from invalid letter #{$x}.

Requires

range-alpha-min-max

@function range-alpha-min-max($min, $max, $lowercase: true) { ... }

Description

Builds a list with letters ranging from $min through $max

Parameters

parameter Name parameter Description parameter Type parameter Default value
$min

Minimum value

String none
$max

Maximum value

String none
$lowercase

Whether the result should be lowercase or uppercase

Boolean

Returns

List

Throws

  • Function range-alpha-min-max expects a string for argument $min but #{type-of($min)} was given.

  • Function range-alpha-min-max expects a string for argument $max but #{type-of($max)} was given.

  • Function range-alpha-min-max expects true or false for argument $lowercase but #{$lowercase} was given.

  • Cannot create range from invalid minimum #{$min}.

  • Cannot create range from invalid maximum #{$max}.

Requires

stringify

@function stringify($list) { ... }

Description

Converts every item in a list to a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list none List</code> or <code>Arglist none

Returns

List

Throws

  • Cannot execute stringify on non-list #{$list}.

Requires

Used by

unstringify

@function unstringify($list) { ... }

Description

Converts unquotes every string in a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list none List</code> or <code>Arglist none

Returns

List

Throws

  • Cannot execute unstringify on non-list #{$list}.

Requires

joins

@function joins($lists...) { ... }

Description

Joins multile lists together into one list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$lists

Multiple lists

Arglist none

Returns

List

Throws

  • Cannot execute joins with non-list #{first($lists)}.

  • Cannot execute joins with non-list #{$list}.

Requires

sum

@function sum($list, $ignorant: false) { ... }

Description

Sums all numeric values in a list, ignoring non-numeric values

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list containing numeric values

List</code> or <code>Arglist none
$ignorant

Whether units should be ignored and subsequently stripped

Boolean

Returns

Number

Returns sum of all numeric values or 0 otherwise

Throws

  • Cannot execute sum on non-list #{$list}.

  • Function range-alpha expects true or false for argument $ignorant but #{$ignorant} was given.

Requires

avg

@function avg($list, $ignorant: false) { ... }

Description

Averages all numeric values in a list, ignoring non-numeric values

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list containing numeric values

List</code> or <code>Arglist none
$ignorant

Whether units should be ignored and subsequently stripped

Boolean

Returns

Number or Null

Returns average of all numeric values or null otherwise

Throws

  • Cannot execute avg on non-list #{$list}.

  • Function range-alpha expects true or false for argument $ignorant but #{$ignorant} was given.

Requires

sort

@function sort($list) { ... }

Description

Sorts a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list to be sorted

List</code> or <code>Arglist none

Returns

List

Throws

  • Cannot execute sort on non-list #{$list}.

Requires

walk

@function walk($list) { ... }

Description

Applies a function to every item within the list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

List

Throws

  • Cannot execute walk on non-list #{$list}.

  • Function walk expects a string for argument $function but #{type-of($function)} was given.

  • Cannot execute walk due to invalid function #{$function}.

Requires

head

@function head($list) { ... }

Description

Retrieves all items from a list except for the last

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

List

Throws

  • Cannot execute head on non-list #{$list}.

Requires

Used by

tail

@function tail($list) { ... }

Description

Retrieves all items from a list except for the first

Parameters

parameter Name parameter Description parameter Type parameter Default value
$list

Some list

List</code> or <code>Arglist none

Returns

List

Throws

  • Cannot execute tail on non-list #{$list}.

Requires

Used by

flatten

@function flatten($|, $limit, $level) { ... }

Description

Flattens a list with any nested lists to a single level

Parameters

parameter Name parameter Description parameter Type parameter Default value
$|

arglist $list - Some list to be flattened

List none
$limit

Limits the number of list levels that should be flattened or 0 when no limit is imposed

Number none
$level

The nesting level of the current list, used for recursion

Number none

Returns

List

Throws

  • Cannot execute flatten on non-list #{$list}.

  • Function flatten expects a number for argument $limit but #{type-of($limit)} was given.

  • Function flatten expects a number for argument $level but #{type-of($level)} was given.

Requires

Used by

Maps

functions

map-deep-get

@function map-deep-get($map, $key) { ... }

Description

Retrieves a property value from a nested map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$map

Some nested map

Map none
$key

A dot-delimited map property

String none

Returns

Mixed

Throws

  • Cannot execute map-deep-get on non-map #{$map}.

Requires

Used by

Author

  • Hugo Giraudel

map-deep-set

@function map-deep-set($map, $key, $value) { ... }

Description

Sets a property value in a nested map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$map

Some nested map

Map none
$key

A dot-delimited map property

String none
$value

Some value

Mixed none

Returns

Map

Throws

  • Cannot execute map-deep-set on non-map #{$map}.

  • Function map-deep-set expects a string for argument $key but #{type-of($key)} was given.

  • Cannot execute map-deep-set since key #{$key} does not exist at level #{$level} in map.

Requires

Used by

Author

  • Hugo Giraudel

map-depth

@function map-depth($map) { ... }

Description

Determines the depth of a map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$map

Some map

Map none

Returns

Number

Throws

  • Cannot execute map-depth on non-map #{$map}.

Requires

Author

  • Hugo Giraudel

map-has-keys

@function map-has-keys($map, $keys) { ... }

Description

Determines whether or not a map contains the one or more keys using dot-delimited syntax for keys

Parameters

parameter Name parameter Description parameter Type parameter Default value
$map

Some nested map

Map none
$keys

A list of dot-delimited map properties to be searched for

String none

Returns

Boolean

Throws

  • Cannot execute map-has-keys on non-map #{$map}.

Requires

Used by

Author

  • Hugo Giraudel

map-combine

@function map-combine($keys, $values) { ... }

Description

Combines a list of keys and a list of values as a map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$keys

A list of keys

List none
$values

A list of values

List none

Returns

Map

Throws

  • Function map-combine expects a list for argument $keys but #{type-of($keys)} was given.

  • Function map-combine expects a list for argument $values but #{type-of($values)} was given.

Requires

Author

  • Hugo Giraudel

map-extend

@function map-extend($map, $maps..., $shallow: false) { ... }

Description

Inspired by jQuery, enables a map to be extended with one or more maps with optional recursion

Parameters

parameter Name parameter Description parameter Type parameter Default value
$map

Some map to be extended

Map none
$maps

Additional maps to be used to extend the first map

Arglist none
$shallow

Passed in as the last argument, disables recursive mode

Boolean

Returns

Map

Throws

  • Cannot execute map-extend on non-map #{$map}.

  • Cannot execute map-extend with non-map #{$current}.

Requires

Author

  • Hugo Giraudel

map-set

@function map-set($map, $key, $value) { ... }

Description

A simplified version of map-merge(), directly sets a map value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$map

Some map

Map none
$key

Some map property

Mixed none
$value

Some map value

Mixed none

Returns

Map

Throws

  • Cannot execute map-set on non-map #{$map}.

Requires

Used by

Author

  • Miriam Suzanne

map-flatten

@function map-flatten($map, $delimiter: '.', $prefix: '') { ... }

Description

Flattens a nested map to a single level of depth

Parameters

parameter Name parameter Description parameter Type parameter Default value
$map

Some map

Map none
$delimiter

Delimits previously nested map levels

String
$prefix

A prefix to be added to keys at the first map level, used for recursion

String

Returns

Map

Throws

  • Cannot execute map-flatten on non-map #{$map}.

  • Function map-flatten expects a string for argument $delimiter but #{type-of($delimiter)} was given.

  • Function map-flatten expects a string for argument $prefix but #{type-of($prefix)} was given.

Requires

Math

functions

deg-to-rad

@function deg-to-rad($degree, $unit: true) { ... }

Description

Converts degrees to radians

Parameters

parameter Name parameter Description parameter Type parameter Default value
$degree

Some degree(s) to be converted

Number none
$unit

Whether units should be included

Boolean

Returns

Number

Requires

Used by

Author

  • Takeru Suzuki

rad-to-deg

@function rad-to-deg($radian, $unit: true) { ... }

Description

Converts radians to degrees

Parameters

parameter Name parameter Description parameter Type parameter Default value
$radian

Some randian(s) to be converted

Number none
$unit

Whether units should be included

Boolean

Returns

Number

Requires

Author

  • Takeru Suzuki

unitless-rad

@function unitless-rad($angle) { ... }

Description

Converts radians to be unitless

Parameters

parameter Name parameter Description parameter Type parameter Default value
$angle

Some radian angle

Number none

Returns

Number or Mixed

Throws

  • 'Angle #{$angle} is not a valid number for unitless-rad.'

Requires

Used by

Author

  • Takeru Suzuki

acos

@function acos($x) { ... }

Description

Calculates the arccosine of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number between -1 and 1

Number none

Returns

Number

Example

acos(0.1) // 1.47063
                      acos(-1)  // 3.14159

Throws

  • 'Argument for acos must be a number between -1 and 1.'

Requires

Author

  • Takeru Suzuki

asin

@function asin($x) { ... }

Description

Calculates the arcsine of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number between -1 and 1

Number none

Returns

Number

Example

asin(0.1) // 0.10017
                      asin(-1)  // -1.5708

Throws

  • 'Argument for asin must be a number between -1 and 1.'

Requires

Used by

Author

  • Takeru Suzuki

atan

@function atan($x) { ... }

Description

Calculates the arctangent of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number

Number none

Returns

Number

Example

atan(0.1) // 0.09967
                      atan(-1)  // -0.7854

Requires

Used by

Author

  • Takeru Suzuki

atanq

@function atanq($y, $x, $negated: false false) { ... }

Description

Calculates the arctangent of the quotient of the given arguments

Parameters

parameter Name parameter Description parameter Type parameter Default value
$y

Some number

Number none
$x

Some number

Number none
$negated

Indicates whether the numbers should be negative

List

Returns

Number

Example

atanq(0, 0)       // 0
                      atanq(0, -0.0)    // -3.14159
                      atanq(-0.0, 0)    // 0
                      atanq(-0.0, -0.0) // -3.14159
                      atanq(0, 1)       // 0
                      atanq(0, -1)      // 3.14159

Requires

Author

  • Takeru Suzuki

cos

@function cos($x) { ... }

Description

Calculates the cosine of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number in radians or degress, assuming radians are unitless

Number none

Returns

Number

Example

cos(0.7854) // 0.70711
                      cos(45deg)  // 0.70711

Requires

Used by

Author

  • Takeru Suzuki

cot

@function cot($x) { ... }

Description

Calculates the cotangent of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number in radians or degress, assuming radians are unitless

Number none

Returns

Number

Example

cot(0.5236) // 1.73205
                      cot(30deg)  // 1.73205

Requires

Author

  • Takeru Suzuki

csc

@function csc($x) { ... }

Description

Calculates the cosecant of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number in radians or degress, assuming radians are unitless

Number none

Returns

Number

Example

csc(1.0472) // 1.1547
                      csc(60deg)  // 1.1547

Requires

Author

  • Takeru Suzuki

exp

@function exp($x) { ... }

Description

Calculates E^x, where x is the argument and E is Euler's constant, the base of the natural logarithms

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x none Number none

Example

exp(1)  // 2.71828
                      exp(-1) // 0.36788

Requires

Author

  • Takeru Suzuki

fact

@function fact($x) { ... }

Description

Calculates the factorial of a non-negative integer

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some non-negative number

Number none

Returns

Number or Null

Example

fact(0) // 1
                      fact(8) // 40320

Throws

  • 'Cannot calculate the fact of negative number #{$x}.'

  • 'Cannot calculate the fact of non-integer #{$x}.'

Author

  • Takeru Suzuki

frexp

@function frexp($x) { ... }

Description

Returns a two-element list containing the normalized fraction and exponent of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number

Number none

Returns

List

In the form of (fraction, exponent)

Used by

Author

  • Takeru Suzuki

ldexp

@function ldexp($x, $exp) { ... }

Description

Calculates $x * 2^$exp

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number

Number none
$exp

Some number representing an exponent

Number none

Returns

Number

Used by

Author

  • Takeru Suzuki

log

@function log($x, $b: null) { ... }

Description

Calculates the natural logarithm of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number

Number none
$b

A base number

Number</code> or <code>Null

Returns

Number

Example

log(2)     // 0.69315
                      log(10)    // 2.30259
                      log(2, 10) // 0.30103

Requires

Used by

Author

  • Takeru Suzuki

pow

@function pow($base, $exp: 1) { ... }

Description

Calculates the base raised to the exponent power

Parameters

parameter Name parameter Description parameter Type parameter Default value
$base

The base number

Number none
$exp

The exponent number

Number

Returns

Number

Example

pow(4, 2)   // 16
                      pow(4, -2)  // 0.0625
                      pow(4, 0.2) // 1.31951

Requires

  • [function] log

Used by

Author

  • Takeru Suzuki

sq

@function sq($base) { ... }

Description

Calculates the base raised to the exponent 2 (squared)

Parameters

parameter Name parameter Description parameter Type parameter Default value
$base

The base number

Number none

Returns

Number

Example

sq(4)   // 16
                      sq(2)   // 4
                      sq(1)   // 1

Requires

  • [function] pow

Used by

Author

  • Takeru Suzuki

cu

@function cu($base) { ... }

Description

Calculates the base raised to the exponent 3 (cubed)

Parameters

parameter Name parameter Description parameter Type parameter Default value
$base

The base number

Number none

Returns

Number

Example

cu(4)   // 64
                      cu(2)   // 8
                      cu(1)   // 1

Requires

  • [function] pow

Author

  • Takeru Suzuki

sec

@function sec($x) { ... }

Description

Calculates the secant of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number in radians or degress, assuming radians are unitless

Number none

Returns

Number

Example

sec(0.7854) // 1.41422
                      sec(45deg)  // 1.41422

Requires

Author

  • Takeru Suzuki

sin

@function sin($x) { ... }

Description

Calculates the sine of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number in radians or degress, assuming radians are unitless

Number none

Returns

Number

Example

sin(1.0472) // 0.86603
                      sin(60deg)  // 0.86603

Requires

Used by

Author

  • Takeru Suzuki

tan

@function tan($x) { ... }

Description

Calculates the tangent of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number in radians or degress, assuming radians are unitless

Number none

Returns

Number

Example

tan(0.5236) // 0.57735
                      tan(30deg)  // 0.57735

Requires

Used by

Author

  • Takeru Suzuki

sqrt

@function sqrt($x) { ... }

Description

Calculates the square root of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number

Number none

Returns

Number or Null

Example

sqrt(2) // 1.41421
                      sqrt(5) // 2.23607

Throws

  • 'Cannot calculate sqrt of negative number #{$x}.'

Requires

  • [function] sq

Used by

Author

  • Takeru Suzuki

Matrices

functions

matrix

@function matrix($rows, $columns) { ... }

Description

Create an empty matrix using 0 as a placeholder value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$rows

The desired number of rows

Number none
$columns

The desired number of columns

Number none

Returns

List

Throws

  • Function matrix expects a number for argument $rows but #{type-of($rows)} was given.

  • Function matrix expects a number for argument $columns but #{type-of($columns)} was given.

Requires

matrix-from

@function matrix-from($rows, $values, $square: true) { ... }

Description

Creates a matrix from a given list of values, optionally made square for uneven lists using 0 as a placeholder value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$rows

The desired number of rows

Number none
$values

The list of values to be used

List none
$square

Whether the matrix should be filled with placeholder value 0 when $values are uneven

Boolean

Throws

  • Function matrix-from expects a number for argument $rows but #{type-of($rows)} was given.

  • Function matrix-from expects a list for argument $values but #{type-of($values)} was given.

  • Function matrix-from expects true or false for argument $square but #{$square} was given.

Requires

Used by

matrix-rows

@function matrix-rows($matrix) { ... }

Description

Counts the number rows in a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none

Returns

Number

Throws

  • Cannot count matrix-rows on non-matrix #{$matrix}.

Requires

Used by

matrix-columns

@function matrix-columns($matrix, $max: true) { ... }

Description

Counts the number of columns in a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$max

Whether to return the maximum or minimum number of columns within the matrix

Boolean

Returns

Number

Throws

  • Cannot count matrix-columns on non-matrix #{$matrix}.

  • Function matrix-columns expects true or false for argument $max but #{$max} was given.

Requires

Used by

matrix-size

@function matrix-size($matrix) { ... }

Description

Counts the number of rows and columns in a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none

Returns

Map

In the form of (rows: 0, columns: 0)

Throws

  • Cannot execute matrix-size on non-matrix #{$matrix}.

Requires

matrix-has-coords

@function matrix-has-coords($matrix, $coordinates) { ... }

Description

Determines if a matrix has the given coordinates

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$coordinates

A set of matrix coordinates where the row value preceeds the column value

List none

Returns

Boolean

Throws

  • Cannot execute matrix-has-coords on non-matrix #{$matrix}.

Requires

matrix-set

@function matrix-set($matrix, $coordinates) { ... }

Description

Sets a value within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$coordinates

A set of matrix coordinates where the row value preceeds the column value

List none

Returns

Matrix

Throws

  • Cannot execute matrix-set on non-matrix #{$matrix}.

Requires

Used by

matrix-set-diagonal

@function matrix-set-diagonal($matrix, $value, $direction) { ... }

Description

Sets all values on a diagonal within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$value

One or more values to set in the given matrix

String</code> or <code>List none
$direction

Designates the starting edge relative to the top

String none

Returns

Matrix

Throws

  • Cannot execute matrix-set-diagonal on non-matrix #{$matrix}.

Requires

matrix-set-row

@function matrix-set-row($matrix, $row, $value) { ... }

Description

Sets all values on a given row with the new value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$row

The row number to be used

Number none
$value

One or more values to set in the given matrix

String</code> or <code>List none

Returns

Matrix

Throws

  • Cannot execute matrix-set-row on non-matrix #{$matrix}.

Requires

matrix-set-column

@function matrix-set-column($matrix, $column, $value) { ... }

Description

Sets all values on a given column with the new value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$column

The column number to be used

Number none
$value

One or more values to set in the given matrix

String</code> or <code>List none

Returns

Matrix

Throws

  • Cannot execute matrix-set-column on non-matrix #{$matrix}.

Requires

matrix-get

@function matrix-get($matrix, $coordinates) { ... }

Description

Gets an values from within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$coordinates

A set of matrix coordinates where the row value preceeds the column value

List none

Returns

Mixed

Throws

  • Cannot execute matrix-get on non-matrix #{$matrix}.

  • Function matrix-get expects valid coordinates for argument $coordinates but #{$coordinates} was given.

Requires

Used by

matrix-get-diagonal

@function matrix-get-diagonal($matrix, $direction) { ... }

Description

Gets all values on a diagonal from within the given matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$direction

Designates the starting edge relative to the top

String none

Returns

List

Throws

  • Cannot execute matrix-get-diagonal on non-matrix #{$matrix}.

  • Function matrix-get-diagonal expects left or right for argument $direction but #{$direction} was given.

Requires

matrix-get-row

@function matrix-get-row($matrix, $row) { ... }

Description

Gets all values from a given row within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$row

The row number to be used

Number none

Returns

List

Throws

  • Cannot execute matrix-get-row on non-matrix #{$matrix}.

  • Function matrix-get-row expects a number for argument $row but #{$row} was given.

Requires

matrix-get-column

@function matrix-get-column($matrix, $column) { ... }

Description

Gets all values from a given column within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$column

The column number to be used

Number none

Returns

List

Throws

  • Cannot execute matrix-get-column on non-matrix #{$matrix}.

  • Function matrix-get-column expects a number for argument $column but #{$column} was given.

Requires

matrix-coords

@function matrix-coords($matrix, $value) { ... }

Description

Get the coordinates of a given value within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$value

Some value to be searched for

Mixed none

Returns

List

A list of one or more cordinates in the form (row, column)

Throws

  • Cannot execute matrix-coords on non-matrix #{$matrix}.

  • Cannot execute matrix-coords since matrix does not contain the value #{$value}.

Requires

Used by

matrix-has-value

@function matrix-has-value($matrix, $value) { ... }

Description

Determines if a matrix has the given value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$value

Some value to be searched for

Mixed none

Returns

Boolean

Throws

  • Cannot execute matrix-has-value on non-matrix #{$matrix}.

Requires

Used by

matrix-swap

@function matrix-swap($matrix, $coordinates1, $coordinates2) { ... }

Description

Swaps the items for two coordinates within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$coordinates1

A set of matrix coordinates where the row value preceeds the column value

List none
$coordinates2

A set of matrix coordinates where the row value preceeds the column value

List none

Returns

Matrix

Throws

  • Cannot execute matrix-swap on non-matrix #{$matrix}.

  • Function matrix-swap expects valid coordinates for argument $coordinates1 but #{$coordinates1} was given.

  • Function matrix-swap expects valid coordinates for argument $coordinates2 but #{$coordinates2} was given.

Requires

matrix-swap-values

@function matrix-swap-values($matrix, $value1, $value2) { ... }

Description

Swaps two values within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$value1

Some value to be swapped

Mixed none
$value2

Another value to be swapper

Mixed none

Returns

Matrix

Throws

  • Cannot execute matrix-swap-values on non-matrix #{$matrix}.

Requires

matrix-swap-rows

@function matrix-swap-rows($matrix, $row1, $row2) { ... }

Description

Swaps two rows within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$row1

A row number of the row to be swapped

Number none
$row2

Another row number of the row to be swapped

Number none

Returns

Matrix

Throws

  • Cannot execute matrix-swap-rows on non-matrix #{$matrix}.

  • Function matrix-swap-rows expects a number for argument $row1 but #{type-of($row1)} was given.

  • Function matrix-swap-rows expects a number for argument $row2 but #{type-of($row2)} was given.

Requires

matrix-swap-columns

@function matrix-swap-columns($matrix, $column1, $column2) { ... }

Description

Swaps two columns within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$column1

A column number of the column to be swapped

Number none
$column2

Another column number of the column to be swapped

Number none

Returns

Matrix

Throws

  • Cannot execute matrix-swap-columns on non-matrix #{$matrix}.

  • Function matrix-swap-columns expects a number for argument $column1 but #{type-of($column1)} was given.

  • Function matrix-swap-columns expects a number for argument $column2 but #{type-of($column2)} was given.

Requires

matrix-replace

@function matrix-replace($matrix, $old, $new) { ... }

Description

Replaces the $old value within a matrix with the $new value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$old

Some old value to be removed

Mixed none
$new

Some new value to be inserted

Mixed none

Returns

Matrix

Throws

  • Cannot execute matrix-replace on non-matrix #{$matrix}.

Requires

matrix-replace-row

@function matrix-replace-row($matrix, $row, $new) { ... }

Description

Replaces the $row at the given index with the $new row

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$row

The row number to be replaced

Number none
$new

The new row contents to be inserted

List</code> or <code>String none

Returns

Matrix

Throws

  • Cannot execute matrix-replace-row on non-matrix #{$matrix}.

  • Function matrix-replace-row expects a number for argument $row but #{type-of($row)} was given.

  • Function matrix-replace-row expects a string or list for argument $new but #{type-of($new)} was given.

Requires

matrix-replace-column

@function matrix-replace-column($matrix, $column, $new) { ... }

Description

Replaces the $column at the given index with the $new column

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$column

The column number to be replaced

Number none
$new

The new column contents to be inserted

List</code> or <code>String none

Returns

Matrix

Throws

  • Cannot execute matrix-replace-column on non-matrix #{$matrix}.

  • Function matrix-replace-column expects a number for argument $column but #{type-of($column)} was given.

  • Function matrix-replace-column expects a string or list for argument $new but #{type-of($new)} was given.

Requires

matrix-shuffle

@function matrix-shuffle($matrix) { ... }

Description

Shuffles the values within a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none

Returns

Matrix

Throws

  • Cannot execute matrix-shuffle on non-matrix #{$matrix}.

Requires

matrix-is-square

@function matrix-is-square($matrix) { ... }

Description

Determines if a matrix has an equal number of columns on all rows

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none

Returns

Boolean

Throws

  • Cannot execute matrix-is-square on non-matrix #{$matrix}.

Requires

Used by

matrix-is-diagonal

@function matrix-is-diagonal($matrix, $direction) { ... }

Description

Determines if a matrix has all values set in a diagonal while all other values are equal to 0

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$direction

Designates the starting edge relative to the top

String none

Returns

Boolean

Throws

  • Cannot execute matrix-is-diagonal on non-matrix #{$matrix}.

  • Function matrix-is-diagonal expects left or right for argument $direction but #{$direction} was given.

Requires

matrix-is-upper-triangular

@function matrix-is-upper-triangular($matrix, $direction) { ... }

Description

Determines if a matrix has all values above its diagonal set while all other values are equal to 0

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$direction

Designates the starting edge relative to the top

String none

Returns

Boolean

Throws

  • Cannot execute matrix-is-upper-triangular on non-matrix #{$matrix}.

  • Function matrix-is-upper-triangular expects left or right for argument $direction but #{$direction} was given.

Requires

matrix-is-lower-triangular

@function matrix-is-lower-triangular($matrix, $direction) { ... }

Description

Determines if a matrix has all values below its diagonal set while all other values are equal to 0

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none
$direction

Designates the starting edge relative to the top

String none

Returns

Boolean

Throws

  • Cannot execute matrix-is-lower-triangular on non-matrix #{$matrix}.

  • Function matrix-is-lower-triangular expects left or right for argument $direction but #{$direction} was given.

Requires

matrix-print

@function matrix-print($matrix) { ... }

Description

Pretty prints a matrix as a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none

Throws

  • Cannot execute matrix-print on non-matrix #{$matrix}.

Requires

Used by

are-coords

@function are-coords($coordinates) { ... }

Description

Determines if a set of given coordinates are valid

Parameters

parameter Name parameter Description parameter Type parameter Default value
$coordinates

A set of matrix coordinates where the row value preceeds the column value

List none

Returns

Boolean

Requires

Used by

mixins

matrix-print

@mixin matrix-print($matrix) { ... }

Description

Outputs the contents of a matrix to the debugging window

Parameters

parameter Name parameter Description parameter Type parameter Default value
$matrix

Some matrix

Matrix none

Throws

  • Cannot execute matrix-print on non-matrix #{$matrix}.

Requires

Numbers

functions

unit-to-digit

@function unit-to-digit($unit) { ... }

Description

Converts some string representation of a unit to its numeric digit

Parameters

parameter Name parameter Description parameter Type parameter Default value
$unit

Some string representation of a unit

String none

Returns

Number

Requires

Used by

convert-unit

@function convert-unit($value, $value, $base: $brandy-font-size) { ... }

Description

Converts one numerical unit to another

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some numeric value

String</code> or <code>Number none
$value

Some unit

String none
$base

The base size in px

Number

Returns

Number or Null

Throws

  • Cannot convert-unit when value #{$value} is non-numeric.

  • Cannot convert-unit for invalid unit #{$unit}.

Requires

Used by

Author

  • Jakob Eriksen

strip-unit

@function strip-unit($value) { ... }

Description

Strips a unit from a numeric value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some numeric value

String</code> or <code>Number none

Returns

Number or Null

Throws

  • 'Cannot execute strip-unit when value #{$value} is non-numeric.'

Requires

Used by

is-negative

@function is-negative($value) { ... }

Description

Determines if a value is equivalent to a negative number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some numeric value

Mixed none

Returns

Boolean

Requires

Used by

is-positive

@function is-positive($value) { ... }

Description

Determines if a value is equivalent to a positive number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some numeric value

Mixed none

Returns

Boolean

Requires

Used by

is-zero

@function is-zero($value) { ... }

Description

Determines if a value is equal to zero

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some numeric value

Mixed none

Returns

Boolean

Requires

extract-unit

@function extract-unit($value) { ... }

Description

Extracts the units from a numeric value

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some numeric value

Mixed none

Returns

String or Null

Throws

  • 'Value #{$value} is non-numeric for extract-unit.'

Requires

Used by

is-percentage (aliased as is-percent )

@function is-percentage($value) { ... }

Description

Determines if a number is a percentage

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-percent (alias for is-percentage)

@function is-percent($value) { ... }

Refer to is-percentage.

is-even

@function is-even($value) { ... }

Description

Determines if a number is even

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

is-odd

@function is-odd($value) { ... }

Description

Determines if a number is odd

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

is-integer

@function is-integer($value) { ... }

Description

Determines if a number is an integer

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-float

@function is-float($value) { ... }

Description

Determines if a number is a float

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-angle

@function is-angle($value) { ... }

Description

Determines if a number is an angle

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-frequency

@function is-frequency($value) { ... }

Description

Determines if a number is an angle

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

is-relative-length

@function is-relative-length($value) { ... }

Description

Determines if a number is a relative length

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-absolute-length

@function is-absolute-length($value) { ... }

Description

Determines if a number is an absolute length

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-length

@function is-length($value) { ... }

Description

Determines if a number is a length

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-resolution

@function is-resolution($value) { ... }

Description

Determines if a number is a resolution

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-time (aliased as is-duration )

@function is-time($value) { ... }

Description

Determines whether some value is a time

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-duration (alias for is-time)

@function is-duration($value) { ... }

Refer to is-time.

is-NaN

@function is-NaN($value) { ... }

Description

Determines whether some value is equal to NaN

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

inverse

@function inverse($number) { ... }

Description

Inverts the sign of a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$number

Some number to invert

Number none

Returns

Number

Throws

  • Cannot execute inverse with non-number #{$number}.

Requires

Author

  • Jason Nickel

px

@function px($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its px equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function px expects a number for argument $value but #{type-of($value)} was given.

  • Function px expects a number for argument $base but #{type-of($base)} was given.

  • Function px expects some px value for argument $base but #{$base} was given.

Requires

Used by

Author

  • Jakob Eriksen

pt

@function pt($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its pt equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function pt expects a number for argument $value but #{type-of($value)} was given.

  • Function pt expects a number for argument $base but #{type-of($base)} was given.

  • Function pt expects some px value for argument $base but #{$base} was given.

Requires

Authors

  • Jakob Eriksen

  • {function} is-number

pc

@function pc($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its pc equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function pc expects a number for argument $value but #{type-of($value)} was given.

  • Function pc expects a number for argument $base but #{type-of($base)} was given.

  • Function pc expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

in

@function in($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its in equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function in expects a number for argument $value but #{type-of($value)} was given.

  • Function in expects a number for argument $base but #{type-of($base)} was given.

  • Function in expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

mm

@function mm($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its mm equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function mm expects a number for argument $value but #{type-of($value)} was given.

  • Function mm expects a number for argument $base but #{type-of($base)} was given.

  • Function mm expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

cm

@function cm($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its cm equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function cm expects a number for argument $value but #{type-of($value)} was given.

  • Function cm expects a number for argument $base but #{type-of($base)} was given.

  • Function cm expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

deg

@function deg($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its deg equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function deg expects a number for argument $value but #{type-of($value)} was given.

  • Function deg expects a number for argument $base but #{type-of($base)} was given.

  • Function deg expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

rad

@function rad($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its rad equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function rad expects a number for argument $value but #{type-of($value)} was given.

  • Function rad expects a number for argument $base but #{type-of($base)} was given.

  • Function rad expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

grad

@function grad($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its grad equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function grad expects a number for argument $value but #{type-of($value)} was given.

  • Function grad expects a number for argument $base but #{type-of($base)} was given.

  • Function grad expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

turn

@function turn($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its turn equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function turn expects a number for argument $value but #{type-of($value)} was given.

  • Function turn expects a number for argument $base but #{type-of($base)} was given.

  • Function turn expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

dpi

@function dpi($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its dpi equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function dpi expects a number for argument $value but #{type-of($value)} was given.

  • Function dpi expects a number for argument $base but #{type-of($base)} was given.

  • Function dpi expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

dpcm

@function dpcm($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its dpcm equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function dpcm expects a number for argument $value but #{type-of($value)} was given.

  • Function dpcm expects a number for argument $base but #{type-of($base)} was given.

  • Function dpcm expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

dppx

@function dppx($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its dppx equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function dppx expects a number for argument $value but #{type-of($value)} was given.

  • Function dppx expects a number for argument $base but #{type-of($base)} was given.

  • Function dppx expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

ms

@function ms($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its ms equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function ms expects a number for argument $value but #{type-of($value)} was given.

  • Function ms expects a number for argument $base but #{type-of($base)} was given.

  • Function ms expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

s

@function s($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its s equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function s expects a number for argument $value but #{type-of($value)} was given.

  • Function s expects a number for argument $base but #{type-of($base)} was given.

  • Function s expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

hz

@function hz($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its hz equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function hz expects a number for argument $value but #{type-of($value)} was given.

  • Function hz expects a number for argument $base but #{type-of($base)} was given.

  • Function hz expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

khz

@function khz($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its khz equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function khz expects a number for argument $value but #{type-of($value)} was given.

  • Function khz expects a number for argument $base but #{type-of($base)} was given.

  • Function khz expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

rem

@function rem($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its rem equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function rem expects a number for argument $value but #{type-of($value)} was given.

  • Function rem expects a number for argument $base but #{type-of($base)} was given.

  • Function rem expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

em

@function em($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its em equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function em expects a number for argument $value but #{type-of($value)} was given.

  • Function em expects a number for argument $base but #{type-of($base)} was given.

  • Function em expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

ex

@function ex($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its ex equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function ex expects a number for argument $value but #{type-of($value)} was given.

  • Function ex expects a number for argument $base but #{type-of($base)} was given.

  • Function ex expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

ch

@function ch($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its ch equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function ch expects a number for argument $value but #{type-of($value)} was given.

  • Function ch expects a number for argument $base but #{type-of($base)} was given.

  • Function ch expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

vw

@function vw($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its vw equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function vw expects a number for argument $value but #{type-of($value)} was given.

  • Function vw expects a number for argument $base but #{type-of($base)} was given.

  • Function vw expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

vh

@function vh($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its vh equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function vh expects a number for argument $value but #{type-of($value)} was given.

  • Function vh expects a number for argument $base but #{type-of($base)} was given.

  • Function vh expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

vmin

@function vmin($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its vmin equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function vmin expects a number for argument $value but #{type-of($value)} was given.

  • Function vmin expects a number for argument $base but #{type-of($base)} was given.

  • Function vmin expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

vmax

@function vmax($value, $base: $brandy-font-size) { ... }

Description

Converts some numeric value to its vmax equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value to convert

Number none
$base

The base size in px

Number

Returns

Number

Throws

  • Function vmax expects a number for argument $value but #{type-of($value)} was given.

  • Function vmax expects a number for argument $base but #{type-of($base)} was given.

  • Function vmax expects some px value for argument $base but #{$base} was given.

Requires

Author

  • Jakob Eriksen

decimal-round

@function decimal-round($number, $digits: 0, $mode: round) { ... }

Description

Rounds a number to the a specific number of digits

Parameters

parameter Name parameter Description parameter Type parameter Default value
$number

Some number to round

Number none
$digits

The desired number of decimal places

Number
$mode

The preferred mode for rounding numbers, either round, ceil, or floor

Number

Returns

Number

Throws

  • Cannot execute decimal-round on non-number #{$number}.

  • Function decimal-round expects a positive integer for argument $digits but #{$digits} was given.

  • Function decimal-round expects round, ceil, or floor for argument $mode but #{$mode} was given.

Requires

Used by

Author

  • Takeru Suzuki

decimal-ceil

@function decimal-ceil($number, $digits: 0) { ... }

Description

Rounds a number up to the a specific number of digits

Parameters

parameter Name parameter Description parameter Type parameter Default value
$number

Some number to ceil

Number none
$digits

The desired number of decimal places

Number

Returns

Number

Throws

  • Cannot execute decimal-ceil on non-number #{$number}.

  • Function decimal-ceil expects a positive integer for argument $digits but #{$digits} was given.

Requires

Author

  • Takeru Suzuki

decimal-floor

@function decimal-floor($number, $digits: 0) { ... }

Description

Rounds a number down to the a specific number of digits

Parameters

parameter Name parameter Description parameter Type parameter Default value
$number

Some number to ceil

Number none
$digits

The desired number of decimal places

Number

Returns

Number

Throws

  • Cannot execute decimal-floor on non-number #{$number}.

  • Function decimal-floor expects a positive integer for argument $digits but #{$digits} was given.

Requires

Author

  • Takeru Suzuki

ratio (aliased as fraction )

@function ratio($x, $y: null, $p: 5) { ... }

Description

Converts a number to its ratio (fraction) equivalent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number

Number none
$y

Some other number or null otherwise

Number</code> or <code>Null
$p

The number of decimal places to consider for floats

Number

Returns

String or Null

Throws

  • Function ratio expects a number for argument $x but #{type-of($x)} was given.

  • Function ratio expects a number or null for argument $y but #{type-of($y)} was given.

  • Function ratio expects a positive integer for argument $p but #{$p} was given.

Requires

Used by

Author

  • Jakob Eriksen

fraction (alias for ratio)

@function fraction($x, $y: null, $p) { ... }

Refer to ratio.

numeric-scale

@function numeric-scale($min: 1, $max: 1, $increasing: false) { ... }

Description

Creates an evenly spaced numeric scale ranging from $min to $max based on the number of desired $stops. Can be either increasing or decreasing based on the value of $increasing. Typically used to help scale fonts sizes, for instance, from h1 to h6.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$min

Some numeric minimum, where $min and $max have the same units

Number
$max

Some numeric maximum, where $min and $max have the same units

Number
$increasing

Whether the scale should be increasing or decreasing

Boolean

Returns

Number

$stops [2] - The desired number of stops within the numeric scale, including the two end points $min and $max

Throws

  • Function numeric-scale expects a number for argument $min but #{type-of($min)} was given.

  • Function numeric-scale expects a number for argument $max but #{type-of($max)} was given.

  • Function numeric-scale expects $min and $max to have the same units but #{unit($min)} and #{unit($max)} were given.

  • Function numeric-scale expects a number for argument $stops but #{type-of($stops)} was given.

  • Function numeric-scale expects a minimum value of 2 for argument $stops but #{$stops} was given.

  • Function numeric-scale expects true or false for argument $increasing but #{$increasing} was given.

Requires

Used by

clamp

@function clamp($number, $min, $max) { ... }

Description

Clamps a numeric value between a $min and $max

Parameters

parameter Name parameter Description parameter Type parameter Default value
$number

The number to clamp between $min and $max

Number none
$min

Some minimum value

Number none
$max

Some maximum value

Number none

Returns

Numbers

Throws

  • Function clamp expects a number for argument $number but #{type-of($number)} was given.

  • Function clamp expects a number for argument $min but #{type-of($min)} was given.

  • Function clamp expects a number for argument $max but #{type-of($max)} was given.

Requires

Scope

mixins

private

@mixin private() { ... }

Description

Helps to create a private variable scope

Parameters

None.

Screens

functions

build-media

@function build-media($media, $max: true) { ... }

Description

Converts a list of media query parameters to a map. If only a number is given as $media, then max-width or min-width is assumed dependent upon whether $max is true or false, respectively.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$media

A one or more media query parameters

List</code> or <code>Number none
$max

Whether numeric values given for $media are assumed as max- or min-

Boolean

Returns

Map

Where null is used in place of any missing values

Throws

  • Function build-media expects a list or number for argument $media but #{type-of($media)} was given.

  • Function build-media expects true or false for argument $max but #{$max} was given.

Requires

Used by

Selectors

functions

selector

@function selector($selectors, $modifiers) { ... }

Description

To build a list of selectors with optional modifier(s)

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

One or more selectors

String</code> or <code>List</code> or <code>Arglist none
$modifiers

One or more modifiers to be added to the selector(s)

String</code> or <code>List</code> or <code>Arglist none

Returns

List

Throws

  • Function selector expects a string or list for argument $selectors but #{type-of($selectors)} was given.

  • Function selector expects a string or list for argument $modifiers but #{type-of($modifiers)} was given.

Requires

Used by

mixins

placeholder

@mixin placeholder($vendors) { ... }

Description

Helps to style placeholder text of input boxes on various browsers

Parameters

parameter Name parameter Description parameter Type parameter Default value
$vendors

A list of vendor prefixes to use

List none

Requires

spinner

@mixin spinner($vendors) { ... }

Description

Helps to style spinners inside number input boxes on various browsers

Parameters

parameter Name parameter Description parameter Type parameter Default value
$vendors

A list of vendor prefixes to use

List none

Requires

first

@mixin first($count: 1) { ... }

Description

Helps to select one or more child elements at the start of a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$count

The number of the elements to select

Number

Used by

Author

  • Lucas Bonomi

last

@mixin last($count: 1) { ... }

Description

Helps to select one or more child elements at the end of a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$count

The number of the elements to select

Number

Used by

Author

  • Lucas Bonomi

first-last

@mixin first-last($count: 1) { ... }

Description

Helps to select one or more child elements at the start and end of a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$count

The number of elements to select

Number

Requires

Author

  • Lucas Bonomi

after-first

@mixin after-first($count: 1) { ... }

Description

Helps to select all child elements after the first child descendant of the parent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$count

The index of the child to start on from the start of the child list minus the first child

Number

Author

  • Lucas Bonomi

before-last

@mixin before-last($count: 1) { ... }

Description

Helps to select all child elements before the last child descendant of the parent

Parameters

parameter Name parameter Description parameter Type parameter Default value
$count

The index of the child to start on from the end of the child list minus the last child

Number

Author

  • Lucas Bonomi

from-start

@mixin from-start($count: 1) { ... }

Description

Helps to select a child element from the start of parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$count

The index of the child to select from the start of the parent's child list

Number

Used by

Author

  • Lucas Bonomi

from-end

@mixin from-end($count: 1) { ... }

Description

Helps to select a child element from the end of parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$count

The index of the child to select from the end of the parent's child list

Number

Used by

Author

  • Lucas Bonomi

from-start-end

@mixin from-start-end($count: 1) { ... }

Description

Helps to select a child element from the start and end of parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$count

The index of the child to select from the top of the parent's child list

Number

Requires

Author

  • Lucas Bonomi

even

@mixin even() { ... }

Description

Helps to select all even numbered child elements from a parent's list of children

Parameters

None.

Author

  • Lucas Bonomi

odd

@mixin odd() { ... }

Description

Helps to select all odd numbered child elements from a parent's list of children

Parameters

None.

Author

  • Lucas Bonomi

between

@mixin between($first: 1, $last: 1) { ... }

Description

Helps to select all child elements between $first and $last from a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$first

The index of the first child element in the parent's child list

Number
$last

The index of the last child element in the parent's child list

Number

Author

  • Lucas Bonomi

even-between

@mixin even-between($first: 1, $last: 1) { ... }

Description

Helps to select all even numbered child elements between $first and $last from a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$first

The index of the first child element in the parent's child list

Number
$last

The index of the last child element in the parent's child list

Number

Author

  • Lucas Bonomi

each-between (aliased as every-between )

@mixin each-between($n, $first: 1, $last: 1) { ... }

Description

Helps to select each child element matching the pattern $n between $first and $last from a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$n

Some pattern of children to select

Number none
$first

The index of the first child element in the parent's child list

Number
$last

The index of the last child element in the parent's child list

Number

Used by

Author

  • Lucas Bonomi

every-between (alias for each-between)

@mixin every-between($n, $first: 1, $last: 1) { ... }

Refer to each-between.

child

@mixin child($index: 1) { ... }

Description

Helps to select a child element by index from a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$index

The index of the child to select from the parent's child list

Number

Author

  • Lucas Bonomi

all-but

@mixin all-but($index: 1) { ... }

Description

Helps to select a child from a parent's list of children excluding the child at the given index

Parameters

parameter Name parameter Description parameter Type parameter Default value
$index

The index of the child to ignore from the parent's child list

Number

Author

  • Lucas Bonomi

all-but-first-last

@mixin all-but-first-last($index: 1) { ... }

Description

Helps to select a child from a parent's list of children excluding the first and last children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$index

The index of the child to select

Number

Author

  • Lucas Bonomi

each (aliased as every )

@mixin each($n: 1) { ... }

Description

Helps to select each child element matching the pattern $n from a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$n

Some pattern of children to select

Number

Used by

Author

  • Lucas Bonomi

every (alias for each)

@mixin every($n: 1) { ... }

Refer to each.

middle

@mixin middle($count) { ... }

Description

Helps to select the middle child element (odd) or middle children elements (even) from a parent's list of children, given a child count

Parameters

parameter Name parameter Description parameter Type parameter Default value
$count

The number of children the parent element should have

Number none

Author

  • Lucas Bonomi

last-of

@mixin last-of($limit: 1) { ... }

Description

Helps to select a the last type-specific child from a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$limit

Some type limitation

Number

Author

  • Lucas Bonomi

at-least

@mixin at-least($x: 1) { ... }

Description

Helps to select child elements with at least $x number of items from a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number of items

Number

Requires

Author

  • Lucas Bonomi

at-most

@mixin at-most($x: 1) { ... }

Description

Helps to select child elements with at most $x number of items from a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$x

Some number of items

Number

Requires

Author

  • Lucas Bonomi

in-between

@mixin in-between($min: 1, $max: 1) { ... }

Description

Helps to select child elements with number of items between $min and $max from a parent's list of children

Parameters

parameter Name parameter Description parameter Type parameter Default value
$min

Minimum number of items

Number
$max

Maximum number of items

Number

Requires

Author

  • Lucas Bonomi

first-child

@mixin first-child() { ... }

Description

Helps to select the first exact child element from a parent's list of children

Parameters

None.

Used by

Author

  • Lucas Bonomi

last-child

@mixin last-child() { ... }

Description

Helps to select the last exact child element from a parent's list of children

Parameters

None.

Used by

Author

  • Lucas Bonomi

first-last-child

@mixin first-last-child() { ... }

Description

Helps to select the first and last exact child elements from a parent's list of children

Parameters

None.

Requires

Author

  • Lucas Bonomi

unique

@mixin unique() { ... }

Description

Helps to select only child elements that are unique to a parent's list of children

Parameters

None.

Author

  • Lucas Bonomi

only (alias for unique)

@mixin only() { ... }

Refer to unique.

not-unique (aliased as not-only )

@mixin not-unique() { ... }

Description

Helps to select only child elements that are not unique to a parent's list of children

Parameters

None.

Author

  • Lucas Bonomi

not-only (alias for not-unique)

@mixin not-only() { ... }

Refer to not-unique.

when-child-of

@mixin when-child-of($context) { ... }

Description

Targets an element when it's an immediate child of another element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$context

Some parent element context

String</code> or <code>List none

Author

  • Hugo Giraudel

when-adjacent-sibling-of

@mixin when-adjacent-sibling-of($context) { ... }

Description

Targets an element when it's an adjacent sibling of another element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$context

Some adjacent sibling element context

String</code> or <code>List none

Author

  • Hugo Giraudel

when-sibling-of

@mixin when-sibling-of($context) { ... }

Description

Targets an element when it's a general sibling of another element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$context

Some sibling element context

String</code> or <code>List none

Author

  • Hugo Giraudel

when-descendant-of

@mixin when-descendant-of($context) { ... }

Description

Targets an element when it's a descendant of another element

Parameters

parameter Name parameter Description parameter Type parameter Default value
$context

Some ascendant element context

String</code> or <code>List none

Author

  • Hugo Giraudel

Setters

mixins

config

@mixin config($key, $value, $overwrite: false) { ... }

Description

Sets a value in the $brandy-config-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$key

A key in the configuration set given in dot notation

String none
$value

Some value

Mixed none
$overwrite

Allows or disallows overwriting of existing properties

Boolean

Throws

  • Configuration #{$key} already exists and overwriting was not permitted.

Requires

const

@mixin const($key, $value) { ... }

Description

Sets a value in the $brandy-const-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$key

A key in the constants map given in dot notation

String none
$value

Some value

Mixed none

Throws

  • Constant #{$key} already exists.

Requires

color

@mixin color($key, $value, $overwrite: false) { ... }

Description

Sets a value in the $brandy-colors-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$key

A key in the colors map given in dot notation

String none
$value

Some value

Mixed none
$overwrite

Allows or disallows overwriting of existing properties

Boolean

Throws

  • Color #{$key} already exists and overwriting was not permitted.

Requires

font

@mixin font($key, $value, $overwrite: false) { ... }

Description

Sets a value in the $brandy-fonts-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$key

A key in the fonts map given in dot notation

String none
$value

Some value

Mixed none
$overwrite

Allows or disallows overwriting of existing properties

Boolean

Throws

  • Font #{$key} already exists and overwriting was not permitted.

Requires

screen

@mixin screen($key, $value, $overwrite: false) { ... }

Description

Sets a value in the $brandy-screens-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$key

A key in the screens map given in dot notation

String none
$value

Some value

Mixed none
$overwrite

Allows or disallows overwriting of existing properties

Boolean

Throws

  • Screen #{$key} already exists and overwriting was not permitted.

Requires

z

@mixin z($key, $value, $overwrite: false) { ... }

Description

Sets a value in the $brandy-z-map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$key

A key in the z map given in dot notation

String none
$value

Some value

Mixed none
$overwrite

Allows or disallows overwriting of existing properties

Boolean

Throws

  • Z-layer #{$key} already exists and overwriting was not permitted.

Requires

Shapes

mixins

triangle

@mixin triangle($direction, $width, $height, $color: $brandy-dark-text) { ... }

Description

Generates a triangle shape pointing in the designated direction

Parameters

parameter Name parameter Description parameter Type parameter Default value
$direction

The desired direction, either up, down, left, right, or dash-delimited up/down plus left/right

String none
$width

The desired width of the triangle

Number none
$height

The desired height of the triangle

Number none
$color

The desired color of the triangle

Color

Throws

  • Mixin triangle cannot use invalid direction #{$direction}.

  • Mixin triangle expects a number for argument $width but #{type-of($width)} was given.

  • Mixin triangle expects a number for argument $height but #{type-of($height)} was given.

  • Mixin triangle expects a color for argument $color but #{type-of($color)} was given.

Requires

Author

  • Thoughtbot, Inc.

chevron

@mixin chevron($direction, $size, $thickness, $color: $brandy-dark-text, $radius: 0) { ... }

Description

Generates a chevron shape pointing in the designated direction

Parameters

parameter Name parameter Description parameter Type parameter Default value
$direction

The desired direction, either up, down, left, right, or dash-delimited up/down plus left/right

String none
$size

The desired width and height of the chevron

Number none
$thickness

The desired thickness of the chevron

Number none
$color

The desired color of the chevron

Color
$radius

The desired border radius of the chevron

Number

Throws

  • Mixin chevron cannot use invalid direction #{$direction}.

  • Mixin chevron expects a number for argument $size but #{type-of($size)} was given.

  • Mixin chevron expects a color for argument $color but #{type-of($color)} was given.

  • Mixin chevron expects a number for argument $radius but #{type-of($radius)} was given.

Requires

circle

@mixin circle($width: 100%, $height: $width, $color: $brandy-dark-text) { ... }

Description

Generates a circular shape, either a circle or oval dependent upon the $width and $height given

Parameters

parameter Name parameter Description parameter Type parameter Default value
$width

The desired width of the circle

Number
$height

The desired height of the circle

Number
$color

The desired color of the circle

Color

Throws

  • Mixin circle expects a number for argument $width but #{type-of($width)} was given.

  • Mixin circle expects a number for argument $height but #{type-of($height)} was given.

  • Mixin circle expects a color for argument $color but #{type-of($color)} was given.

Requires

square

@mixin square($width: 100%, $height: $width, $color: $brandy-dark-text) { ... }

Description

Generates a square shape, either a square or rectangle dependent upon the $width and $height given

Parameters

parameter Name parameter Description parameter Type parameter Default value
$width

The desired width of the square

Number
$height

The desired height of the square

Number
$color

The desired color of the square

Color

Throws

  • Mixin square expects a number for argument $width but #{type-of($width)} was given.

  • Mixin square expects a number for argument $height but #{type-of($height)} was given.

  • Mixin square expects a color for argument $color but #{type-of($color)} was given.

Requires

Sprites

functions

sprite

@function sprite($image, $rows, $ids, $size, $spacing: 0) { ... }

Description

Builds a sprite object for easy manipulation

Parameters

parameter Name parameter Description parameter Type parameter Default value
$image

Some path for an image sprite

String none
$rows

The number of rows in the image sprite

Number none
$ids

A list of unique identifiers for each image within the sprite

List none
$size

A list of numbers containing the width and height of each image in the sprite

List none
$spacing

The amount of spacing between each image in the sprite

Number

Returns

Sprite

Throws

  • Function sprite expects a string for argument $image but #{type-of($image)} was given.

  • Function sprite expects a number for argument $rows but #{type-of($rows)} was given.

  • Function sprite expects a list for argument $ids but #{type-of($ids)} was given.

  • Function sprite expects all items in list $ids to be unique.

  • Function sprite expects a list for argument $size but #{type-of($size)} was given.

  • Function sprite expects argument $size to have a length of 2 but length was #{length($size)}.

  • Function sprite expects a number for first item, width, in list $size but #{type-of($width)} was given.

  • Function sprite expects a number for second item, height, in list $size but #{type-of($height)} was given.

  • Function sprite expects a number for argument $spacing but #{type-of($spacing)} was given.

Requires

sprite-url

@function sprite-url($sprite) { ... }

Description

Gets the image path of an image sprite with a sprite object

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none

Returns

String

Throws

  • Cannot execute sprite-url on non-sprite #{$sprite}.

Requires

Used by

sprite-set-url

@function sprite-set-url($sprite, $url) { ... }

Description

Sets the image path associated with a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none
$url

A path to an image sprite

String none

Returns

Sprite

Throws

  • Cannot execute sprite-set-url on non-sprite #{$sprite}.

  • Function sprite-set-url expects a string for argument $url but #{type-of($url)} was given.

Requires

sprite-spacing

@function sprite-spacing($sprite) { ... }

Description

Gets the spacing between images within a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none

Returns

Number

Throws

  • Cannot execute sprite-spacing on non-sprite #{$sprite}.

Requires

Used by

sprite-set-spacing

@function sprite-set-spacing($sprite, $spacing) { ... }

Description

Sets the spacing between images within a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none
$spacing

The amount of spacing between images within the sprite

Number none

Returns

Sprite

Throws

  • Cannot execute sprite-set-spacing on non-sprite #{$sprite}.

  • Function sprite-set-spacing expects a number for argument $spacing but #{type-of($spacing)} was given.

Requires

sprite-width

@function sprite-width($sprite) { ... }

Description

Gets the width of the images within a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none

Returns

Number

Throws

  • Cannot execute sprite-width on non-sprite #{$sprite}.

Requires

Used by

sprite-set-width

@function sprite-set-width($sprite, $width) { ... }

Description

Sets the width of the images within a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none
$width

The width of each image in the sprite

Number none

Returns

Sprite

Throws

  • Cannot execute sprite-set-width on non-sprite #{$sprite}.

  • Function sprite-set-width expects a number for argument $width but #{type-of($width)} was given.

Requires

sprite-height

@function sprite-height($sprite) { ... }

Description

Gets the height of the images within a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none

Returns

Number

Throws

  • Cannot execute sprite-height on non-sprite #{$sprite}.

Requires

Used by

sprite-set-height

@function sprite-set-height($sprite, $height) { ... }

Description

Sets the height of the images within a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none
$height

The height of each image in the sprite

Number none

Returns

Sprite

Throws

  • Cannot execute sprite-set-height on non-sprite #{$sprite}.

  • Function sprite-set-height expects a number for argument $height but #{type-of($height)} was given.

Requires

sprite-size

@function sprite-size($sprite) { ... }

Description

Gets the width and height of the images within a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none

Returns

List

In the format (width height)

Throws

  • Cannot execute sprite-size on non-sprite #{$sprite}.

Requires

sprite-set-size

@function sprite-set-size($sprite, $size) { ... }

Description

Sets the width and height of the images within a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none
$size

The list of numbers correlating to the width and height of each image in the sprite

List none

Returns

Sprite

Throws

  • Cannot execute sprite-set-size on non-sprite #{$sprite}.

  • Function sprite-set-size expects a list for argument $size but #{type-of($size)} was given.

  • Function sprite-set-size expects argument $size to have a length of 2 but length was #{length($size)}.

  • Function sprite-set-size expects a number for first item, width, in list $size but #{type-of($width)} was given.

  • Function sprite-set-size expects a number for second item, height, in list $size but #{type-of($height)} was given.

Requires

sprite-position

@function sprite-position($sprite, $id) { ... }

Description

Locates an item by ID within a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object

Sprite none
$id

The identifier of the target item within the sprite object

String none

Returns

List

In the format (x y)

Throws

  • Cannot execute sprite-position on non-sprite #{$sprite}.

  • Cannot execute sprite-position since sprite does not contain the value #{$id}.

Requires

Used by

mixins

sprite-image

@mixin sprite-image($sprite, $id, $repeat: false) { ... }

Description

Extracts an image from a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$sprite

Some sprite object to extract an image from

Sprite none
$id

The identifier of the image to be extracted from the sprite object

String none
$repeat

Whether the sprite image should be repeating

Boolean

Throws

  • Mixin sprite-image expects a sprite for argument $sprite but #{type-of($sprite)} was given.

  • Mixin sprite-image expects a string for argument $id but #{type-of($id)} was given.

  • Mixin sprite-image expects a true or false for argument $repeat but #{$repeat} was given.

Requires

States

mixins

on-event

@mixin on-event($self: false, $events: hover active focus) { ... }

Description

Sets an element's event state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$self

Whether or not the include the current selector

Boolean
$events

The types of events to include

List

Author

  • Harry Roberts

on-hover

@mixin on-hover($property, $normal, $hover) { ... }

Description

Sets a property's normal and hover state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$hover

Some property value for the hover state

Mixed none

Author

  • Kyle Brumm

on-focus

@mixin on-focus($property, $normal, $focus) { ... }

Description

Sets a property's normal and focus state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$focus

Some property value for the focus state

Mixed none

on-hover-focus (aliased as on-focus-hover )

@mixin on-hover-focus($property, $normal, $hover-focus) { ... }

Description

Sets a property's normal, hover, and focus state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$hover-focus

Some property value for the hover and focus state

Mixed none

Used by

on-focus-hover (alias for on-hover-focus)

@mixin on-focus-hover($property, $normal, $hover-focus) { ... }

Refer to on-hover-focus.

on-hover-focus-active (aliased as on-hover-active-focus on-focus-hover-active on-focus-active-hover on-active-hover-focus on-active-focus-hover )

@mixin on-hover-focus-active($property, $normal, $hover) { ... }

Description

Sets a property's normal, hover, focus, and active state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$hover

Some property value for the hover state

Mixed none

Used by

on-hover-active-focus (alias for on-hover-focus-active)

@mixin on-hover-active-focus($property, $normal, $hover) { ... }

Refer to on-hover-focus-active.

on-focus-hover-active (alias for on-hover-focus-active)

@mixin on-focus-hover-active($property, $normal, $hover) { ... }

Refer to on-hover-focus-active.

on-focus-active-hover (alias for on-hover-focus-active)

@mixin on-focus-active-hover($property, $normal, $hover) { ... }

Refer to on-hover-focus-active.

on-active-hover-focus (alias for on-hover-focus-active)

@mixin on-active-hover-focus($property, $normal, $hover) { ... }

Refer to on-hover-focus-active.

on-active-focus-hover (alias for on-hover-focus-active)

@mixin on-active-focus-hover($property, $normal, $hover) { ... }

Refer to on-hover-focus-active.

on-active

@mixin on-active($property, $normal, $active) { ... }

Description

Sets a property's normal and active state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$active

Some property value for the active state

Mixed none

on-visited

@mixin on-visited($property, $normal, $visited) { ... }

Description

Sets a property's normal and visited state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$visited

Some property value for the visited state

Mixed none

on-target

@mixin on-target($property, $normal, $target) { ... }

Description

Sets a property's normal and target state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$target

Some property value for the target state

Mixed none

on-disabled

@mixin on-disabled($property, $normal, $disabled) { ... }

Description

Sets a property's normal and disabled state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$disabled

Some property value for the disabled state

Mixed none

on-enabled

@mixin on-enabled($property, $normal, $enabled) { ... }

Description

Sets a property's normal and enabled state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$enabled

Some property value for the enabled state

Mixed none

on-checked

@mixin on-checked($property, $normal, $checked) { ... }

Description

Sets a property's normal and checked state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$checked

Some property value for the checked state

Mixed none

on-not-checked

@mixin on-not-checked($property, $normal, $not-checked) { ... }

Description

Sets a property's normal and not checked state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$not-checked

Some property value for the not-checked state

Mixed none

on-indeterminate

@mixin on-indeterminate($property, $normal, $indeterminate) { ... }

Description

Sets a property's normal and indeterminate state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$indeterminate

Some property value for the indeterminate state

Mixed none

on-required

@mixin on-required($property, $normal, $required) { ... }

Description

Sets a property's normal and required state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$required

Some property value for the required state

Mixed none

on-optional

@mixin on-optional($property, $normal, $optional) { ... }

Description

Sets a property's normal and optional state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$optional

Some property value for the optional state

Mixed none

on-read-only

@mixin on-read-only($property, $normal, $read-only) { ... }

Description

Sets a property's normal and read-only state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$read-only

Some property value for the read-only state

Mixed none

on-read-write

@mixin on-read-write($property, $normal, $read-write) { ... }

Description

Sets a property's normal and read-write state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$read-write

Some property value for the read-write state

Mixed none

on-empty

@mixin on-empty($property, $normal, $enabled) { ... }

Description

Sets a property's normal and empty state

Parameters

parameter Name parameter Description parameter Type parameter Default value
$property

Some property to set

String none
$normal

Some property value for the normal state

Mixed none
$enabled

Some property value for the empty state

Mixed none

Strings

functions

str-replace

@function str-replace($string, $search, $replace: '') { ... }

Description

Replaces all instances of a search string with a replacement string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

The string to be worked on

String none
$search

The string to be searched for

String none
$replace

The string to be used as a replacement

String

Returns

String

Throws

  • Function str-replace expects a string for argument $string but #{type-of($string)} was given.

  • Function str-replace expects a string for argument $search but #{type-of($search)} was given.

  • Function str-replace expects a string for argument $replace but #{type-of($replace)} was given.

Requires

Used by

Author

  • Hugo Giraudel

str-split

@function str-split($string, $delimiter: ',') { ... }

Description

Splits a string into a list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

The string to be worked on

String none
$delimiter

The string delimiter

String

Returns

List

Throws

  • Function str-split expects a string for argument $string but #{type-of($string)} was given.

  • Function str-split expects a string for argument $delimiter but #{type-of($delimiter)} was given.

Requires

Used by

str-trim

@function str-trim($string, $characters: ' ') { ... }

Description

Removes extra characters from the start and end of a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

The string to be worked on

String none
$characters

One or more characters to be trimmed

String</code> or <code>List

Returns

String

Throws

  • Function str-trim expects a string for argument $string but #{type-of($string)} was given.

  • Function str-trim expects a string or list for argument $characters but #{type-of($characters)} was given.

Requires

Used by

str-trim-right

@function str-trim-right($string, $characters: ' ') { ... }

Description

Removes extra characters from the end of a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

The string to be worked on

String none
$characters

One or more characters to be trimmed

String</code> or <code>List

Returns

String

Throws

  • Function str-trim-right expects a string for argument $string but #{type-of($string)} was given.

  • Function str-trim-right expects a string or list for argument $characters but #{type-of($characters)} was given.

Requires

str-trim-left

@function str-trim-left($string, $characters: ' ') { ... }

Description

Removes extra characters from the start of a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

The string to be worked on

String none
$characters

One or more characters to be trimmed

String</code> or <code>List

Returns

String

Throws

  • Function str-trim-left expects a string for argument $string but #{type-of($string)} was given.

  • Function str-trim-left expects a string or list for argument $characters but #{type-of($characters)} was given.

Requires

str-contains

@function str-contains($string, $search) { ... }

Description

Determines if a string contains another string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

The string to be worked on

String none
$search

The string to be searched for

String none

Returns

String

Throws

  • Function str-contains expects a string for argument $string but #{type-of($string)} was given.

  • Function str-contains expects a string for argument $search but #{type-of($search)} was given.

Requires

str-starts-with

@function str-starts-with($string, $search) { ... }

Description

Determines if a string starts with another string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

The string to be worked on

String none
$search

The string to be searched for

String none

Returns

String

Throws

  • Function str-contains expects a string for argument $string but #{type-of($string)} was given.

  • Function str-contains expects a string for argument $search but #{type-of($search)} was given.

Requires

str-ends-with

@function str-ends-with($string, $search) { ... }

Description

Determines if a string ends with another string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

The string to be worked on

String none
$search

The string to be searched for

String none

Returns

String

Throws

  • Function str-contains expects a string for argument $string but #{type-of($string)} was given.

  • Function str-contains expects a string for argument $search but #{type-of($search)} was given.

Requires

str-reverse

@function str-reverse($string) { ... }

Description

Reverses a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

String

Throws

  • Cannot execute str-reverse on non-string #{$string}.

Requires

Used by

str-is-palindrome

@function str-is-palindrome($string) { ... }

Description

Determines if a string is a palindrome

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

Boolean

Throws

  • Cannot execute str-is-palindrome on non-string #{$string}.

Requires

str-is-letter

@function str-is-letter($string) { ... }

Description

Determines if a string is a letter

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

Boolean

Throws

  • Cannot execute str-is-letter on non-string #{$string}.

Requires

Used by

str-is-symbol

@function str-is-symbol($string) { ... }

Description

Determines if a string is a symbol

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

Boolean

Throws

  • Cannot execute str-is-symbol on non-string #{$string}.

Requires

Used by

str-is-unit

@function str-is-unit($string) { ... }

Description

Determines if a string is representative of some units

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string representation of a unit

String none

Returns

Boolean

Throws

  • Cannot execute str-is-unit on non-string #{$string}.

Requires

Used by

str-is-number

@function str-is-number($string) { ... }

Description

Determines if a string is a number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

Boolean

Throws

  • Cannot execute str-is-number on non-string #{$string}.

Requires

Used by

str-between

@function str-between($string, $first, $last, $inclusive: true) { ... }

Description

Retrieves the substring between two characters

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string to be indexed

String none
$first

The first character to look for, optionally passed as a list where second item indicates occurrence index

String</code> or <code>List none
$last

The last character to look for, optionally passed as a list where second item indicates occurrence index

String</code> or <code>List none
$inclusive

Whether or not the $first and $last characters should be included

Boolean

Returns

String

The string between $first and $last or '' if no occurrence of $last follows $first

Throws

  • Function str-between expects a string for argument $string but #{type-of($string)} was given.

  • Function str-between expects a string or list for argument $first but #{type-of($first)} was given.

  • Function str-between expects a string or list for argument $last but #{type-of($last)} was given.

  • Function str-between expects true or false for argument $inclusive but #{$inclusive} was given.

  • Function str-between only permits one character for arguments $first and $last.

  • Function str-between expects first argument in list $first to be a string but #{type-of(first($first))} given.

  • Function str-between expects last argument in list $first to be a number but #{type-of(last($first))} given.

  • Function str-between expects first argument in list $last to be a string but #{type-of(first($last))} given.

  • Function str-between expects last argument in list $last to be a number but #{type-of(last($last))} given.

Requires

char-at

@function char-at($string, $index) { ... }

Description

Extracts a character at the given index within a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none
$index

The index at which the character should be extracted

Number none

Returns

String

Throws

  • Function char-at expects a string for argument $string but #{type-of($string)} was given.

  • Function char-at expects a number for argument $index but #{type-of($index)} was given.

Requires

Used by

chars-at

@function chars-at($string, $indices...) { ... }

Description

Extracts the characters at the given indices within a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none
$indices

One or more numeric indexes at which the character should be extracted

Arglist none

Returns

List

Throws

  • Function chars-at expects a string for argument $string but #{type-of($string)} was given.

  • Function chars-at expects a list of numbers for argument $indices but #{type-of($index)} was given.

Requires

char-first (aliased as str-first )

@function char-first($string) { ... }

Description

Extracts the first character from a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

String

Throws

  • Cannot execute char-first on non-string #{$string}.

Requires

Used by

char-last (aliased as str-last )

@function char-last($string) { ... }

Description

Extracts the last character from a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

String

Throws

  • Cannot execute char-last on non-string #{$string}.

Requires

Used by

chars-between

@function chars-between($string, $first, $last, $inclusive: true) { ... }

Description

Counts the number of characters between two characters within a string, optionally passing occurrence index

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string to be indexed

String none
$first

The first character to look for, optionally passed as a list where second item indicates occurrence index

String</code> or <code>List none
$last

The last character to look for, optionally passed as a list where second item indicates occurrence index

String</code> or <code>List none
$inclusive

Whether or not the $last character should be counted

Boolean

Returns

Number

The number of characters between $first and $last or 0 if no occurrence of $last follows $first

Throws

  • Function char-count-between expects a string for argument $string but #{type-of($string)} was given.

  • Function char-count-between expects a string or list for argument $first but #{type-of($first)} was given.

  • Function char-count-between expects a string or list for argument $last but #{type-of($last)} was given.

  • Function char-count-between expects true or false for argument $inclusive but #{$inclusive} was given.

  • Function char-count-between only permits one character for arguments $first and $last.

  • Function char-count-between expects first argument in list $first to be a string but #{type-of(first($first))} given.

  • Function char-count-between expects last argument in list $first to be a number but #{type-of(last($first))} given.

  • Function char-count-between expects first argument in list $last to be a string but #{type-of(first($last))} given.

  • Function char-count-between expects last argument in list $last to be a number but #{type-of(last($last))} given.

Requires

char-count

@function char-count($string) { ... }

Description

Counts the number of characters in a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string to be counted

String none

Returns

Number

Throws

  • Cannot execute char-count on non-string #{$string}.

Requires

str-word-count

@function str-word-count($string) { ... }

Description

Counts the number of words in a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string to be counted

String none

Returns

Number

Throws

  • Cannot execute str-word-count on non-string #{$string}.

Requires

str-first (alias for char-first)

@function str-first($string) { ... }

Refer to char-first.

str-last (alias for char-last)

@function str-last($string) { ... }

Refer to char-last.

str-tail

@function str-tail($string) { ... }

Description

Retrieves all characters in a string except for the first

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

String

Throws

  • Cannot execute str-tail on non-string #{$string}.

Requires

Used by

str-head

@function str-head($string) { ... }

Description

Retrieves all characters in a string except for the last

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

String

Throws

  • Cannot execute str-head on non-string #{$string}.

Requires

str-last-index

@function str-last-index($string, $needle) { ... }

Description

Looks up the last index of a string within the given string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string to be searched on

String none
$needle

Some string to be searched for

String none

Returns

String or Null

Throws

  • Function str-last-index expects a string for argument $string but #{type-of($string)} was given.

  • Function str-last-index expects a string for argument $needle but #{type-of($needle)} was given.

Requires

str-pad

@function str-pad($string, $length: str-length($string) + 1, $filler: ' ', $direction: left) { ... }

Description

Pads a string on the given direction with the $filler until preferred $length is reached

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string to be padded

String none
$length

The preferred length of the string

String
$filler

The string to used as the filler

String
$direction

The direction to add the padding

String

Returns

String

Throws

  • Function str-pad expects a string for argument $string but #{type-of($string)} was given.

  • Function str-pad expects a string for argument $filler but #{type-of($filler)} was given.

  • Function str-pad expects a number for argument $length but #{type-of($length)} was given.

  • Function str-pad expects left or right for argument $direction but #{($direction)} was given.

Requires

str-shuffle

@function str-shuffle($string) { ... }

Description

Shuffle all characters within a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string to be shuffled

String none

Returns

String

Throws

  • Cannot execute str-shuffle on non-string #{$string}.

Requires

to-upper-case-first

@function to-upper-case-first($string) { ... }

Description

Capitalizes the first letter in a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

String

Throws

  • Cannot execute to-upper-case-first on non-string #{$string}.

Requires

to-lower-case-first

@function to-lower-case-first($string) { ... }

Description

Lowercases the first letter in a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

String

Throws

  • Cannot execute to-lower-case-first on non-string #{$string}.

Requires

to-capitalize

@function to-capitalize($string) { ... }

Description

Capitalizes the first letter of each word in a string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

String

Throws

  • Cannot execute to-capitalize on non-string #{$string}.

Requires

to-title-case

@function to-title-case($string) { ... }

Description

Titlecases a string, ignoring words in $brandy-title-blacklist

Parameters

parameter Name parameter Description parameter Type parameter Default value
$string

Some string

String none

Returns

String

Throws

  • Cannot execute to-title-case on non-string #{$string}.

Requires

Testing

mixins

test

@mixin test($function, $tests, $arglist) { ... }

Description

Enables unit testing of Sass functions

Parameters

parameter Name parameter Description parameter Type parameter Default value
$function

The name of some function to be tested

String none
$tests

One or more tests to be run

Map none
$arglist

Whether the arguments passed into the test are in the form of an arglist or list otherwise

Boolean none

Requires

compare

@mixin compare($variable, $tests, $comp) { ... }

Description

Enables comparative testing of Sass variables

Parameters

parameter Name parameter Description parameter Type parameter Default value
$variable

The name of some function to be tested

String none
$tests

One or more tests to be run

Map none
$comp

The name of comparative function to use for comparison

String none

Requires

Text

mixins

long-text-shadow

@mixin long-text-shadow($color, $offset: 2px, $distance: 50) { ... }

Description

Creates a long text shadow effect.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

The desired color of the shadow

Color none
$offset

The distance the shadow should be offset from the text, includes both x and y

Number
$distance

The total distance of the long shadow effect

Number

long-fading-text-shadow

@mixin long-fading-text-shadow($color, $offset: 2px, $distance: 50) { ... }

Description

Creates a long, fading text shadow effect.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$color

The desired color of the shadow

Color none
$offset

The distance the shadow should be offset from the text, includes both x and y

Number
$distance

The total distance of the long shadow effect

Number

Types

functions

is-null

@function is-null($value) { ... }

Description

Determines whether some value is of type null

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Used by

is-boolean (aliased as is-bool )

@function is-boolean($value) { ... }

Description

Determines whether some value is of type bool

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Used by

is-bool (alias for is-boolean)

@function is-bool($value) { ... }

Refer to is-boolean.

is-map

@function is-map($value) { ... }

Description

Determines whether some value is of type map

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Used by

is-number

@function is-number($value) { ... }

Description

Determines whether some value is of type number

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Used by

is-color

@function is-color($value) { ... }

Description

Determines whether some value is of type color

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Used by

is-list

@function is-list($value) { ... }

Description

Determines whether some value is of type list

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Used by

is-arglist

@function is-arglist($value) { ... }

Description

Determines whether some value is of type arglist

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Used by

is-string

@function is-string($value) { ... }

Description

Determines whether some value is of type string

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Used by

is-matrix

@function is-matrix($value) { ... }

Description

Determines whether some value resembles a matrix

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-sprite

@function is-sprite($value) { ... }

Description

Determines whether some value resembles a sprite

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Used by

is-position

@function is-position($value) { ... }

Description

Determines whether some value is a position

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some value

Mixed none

Returns

Boolean

Requires

Utilities

mixins

add-buttons

@mixin add-buttons($selectors...) { ... }

Description

Adds one or more new button selectors to the global selector variable $all-buttons

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function add-buttons expects selectors to be a string but #{$selector} was given.

Requires

remove-buttons

@mixin remove-buttons($selectors...) { ... }

Description

Removes one or more button selectors from the global selector variable $all-buttons

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function remove-buttons expects selectors to be a string but #{$selector} was given.

Requires

add-text-inputs

@mixin add-text-inputs($selectors...) { ... }

Description

Adds one or more new text input selectors to the global selector variable $all-text-inputs

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function add-text-inputs expects selectors to be a string but #{$selector} was given.

Requires

remove-text-inputs

@mixin remove-text-inputs($selectors...) { ... }

Description

Removes one or more text input selectors from the global selector variable $all-text-inputs

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function remove-text-inputs expects selectors to be a string but #{$selector} was given.

Requires

add-list-inputs

@mixin add-list-inputs($selectors...) { ... }

Description

Adds one or more new list input selectors to the global selector variable $all-list-inputs

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function add-list-inputs expects selectors to be a string but #{$selector} was given.

Requires

remove-list-inputs

@mixin remove-list-inputs($selectors...) { ... }

Description

Removes one or more list input selectors from the global selector variable $all-list-inputs

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function remove-list-inputs expects selectors to be a string but #{$selector} was given.

Requires

add-file-inputs

@mixin add-file-inputs($selectors...) { ... }

Description

Adds one or more new file input selectors to the global selector variable $all-file-inputs

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function add-file-inputs expects selectors to be a string but #{$selector} was given.

Requires

remove-file-inputs

@mixin remove-file-inputs($selectors...) { ... }

Description

Removes one or more file input selectors from the global selector variable $all-file-inputs

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function remove-file-inputs expects selectors to be a string but #{$selector} was given.

Requires

add-toggle-inputs

@mixin add-toggle-inputs($selectors...) { ... }

Description

Adds one or more new toggle input selectors to the global selector variable $all-toggle-inputs

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function add-toggle-inputs expects selectors to be a string but #{$selector} was given.

Requires

remove-toggle-inputs

@mixin remove-toggle-inputs($selectors...) { ... }

Description

Removes one or more toggle input selectors from the global selector variable $all-toggle-inputs

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function remove-toggle-inputs expects selectors to be a string but #{$selector} was given.

Requires

add-headings

@mixin add-headings($selectors...) { ... }

Description

Adds one or more new heading selectors to the global selector variable $all-headings

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function add-headings expects selectors to be a string but #{$selector} was given.

Requires

remove-toggle-inputs

@mixin remove-toggle-inputs($selectors...) { ... }

Description

Removes one or more heading selectors from the global selector variable $all-headings

Parameters

parameter Name parameter Description parameter Type parameter Default value
$selectors

A list of string selectors

Arglist none

Throws

  • Function remove-headings expects selectors to be a string but #{$selector} was given.

Requires

brandy.help

functions

default

@function default($values...) { ... }

Description

Defaults to a certain value if no other given values are set.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$values

Some values to use in order of preference, where the last value is the default

Arglist none

Returns

Mixed

The first value that is set or the default value

Requires

default-if

@function default-if($condition, $values...) { ... }

Description

Default to a certain value if no other given value passes the condition test.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$condition

The name of a function to be used as the test condition

String none
$values

Some values to use in order of preference, where the last value is the default

Arglist none

Returns

Mixed

The first value that meets the condition or the default value

Requires

default-if-not

@function default-if-not($condition, $values...) { ... }

Description

Default to a certain value if no other given value fails the condition test.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$condition

The name of a function to be used as the test condition

String none
$values

Some values to use in order of preference, where the last value is the default

Arglist none

Returns

Mixed

The first value that does not meet the condition or the default value

Requires

important

@function important($value, $important: false) { ... }

Description

Conditionally makes a property value !important if a flag is set, where the flag is typically set based on the result of some conditional expression or result of a function.

Parameters

parameter Name parameter Description parameter Type parameter Default value
$value

Some property value

Mixed none
$important

A flag indicating whether the value should be !important

Boolean

Returns

Mixed

The given value either with or without !important